Skip to content

Commit df4c12a

Browse files
committed
add throw on error
1 parent a73bf25 commit df4c12a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/Routes/Account.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static function respondToAccountVerify() {
5050
$responseData = "OK";
5151
header("HTTP/1.1 201 Created");
5252
header("Content-type: application/json");
53-
echo json_encode($responseData, JSON_PRETTY_PRINT);
53+
echo json_encode($responseData, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR);
5454
}
5555

5656
public static function respondToAccountNew() {
@@ -95,7 +95,7 @@ public static function respondToAccountNew() {
9595
header("HTTP/1.1 201 Created");
9696
header("Content-type: application/json");
9797
Session::start($_POST['email']);
98-
echo json_encode($responseData, JSON_PRETTY_PRINT);
98+
echo json_encode($responseData, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR);
9999
}
100100

101101
public static function respondToAccountResetPassword() {
@@ -221,7 +221,7 @@ public static function respondToRegister() {
221221
);
222222
header("HTTP/1.1 201 Created");
223223
header("Content-type: application/json");
224-
echo json_encode($responseData, JSON_PRETTY_PRINT);
224+
echo json_encode($responseData, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR);
225225
}
226226

227227
public static function respondToSharing() {

lib/Routes/SolidIdp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public static function respondToRegister() {
145145
);
146146
header("HTTP/1.1 201 Created");
147147
header("Content-type: application/json");
148-
echo json_encode($responseData, JSON_PRETTY_PRINT);
148+
echo json_encode($responseData, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR);
149149
}
150150

151151
public static function respondToSharing() {

lib/Server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,6 @@ public static function respond($response) {
161161
header($header . ":" . $value);
162162
}
163163
}
164-
echo json_encode($body, JSON_PRETTY_PRINT);
164+
echo json_encode($body, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR);
165165
}
166166
}

0 commit comments

Comments
 (0)