Copy 404 handling to connexion.php

This commit is contained in:
Angus B. Grieve-Smith 2020-04-30 13:21:56 -04:00
parent e34253faf8
commit 6da202fe7c
2 changed files with 11 additions and 2 deletions

View File

@ -50,7 +50,16 @@ else
} }
catch (Exception $e) catch (Exception $e)
{ {
if ($e->getCode() == 404) {
$resp = json_encode(
[
"error" => "User not found",
"message" => "$user is not in the group of authorized users."
]
);
} else {
$resp = json_encode(array("error" => "Impossible to get data", "message" => $e->getMessage())); $resp = json_encode(array("error" => "Impossible to get data", "message" => $e->getMessage()));
}
$authenticated = false; $authenticated = false;
} }

View File

@ -89,7 +89,7 @@ catch (Exception $e)
if ($e->getCode() == 404) { if ($e->getCode() == 404) {
$resp = [ $resp = [
"error" => "User not found", "error" => "User not found",
"message" => "<b>$user</b> is not in the group of authorized users." "message" => "$user is not in the group of authorized users."
]; ];
} else { } else {
$resp = array( $resp = array(