No connection to API causes error
ghukill opened this issue · comments
Graham Hukill commented
Now that the front-end pings the API about the user, if that connection is down and that ping fails, it errors and no page is rendered.
The application could not run because of the following error:
Details
Type: GuzzleHttp\Exception\ServerException
Code: 503
Message: Server error: `GET http://localhost/api/user/USERNAME_HERE/whoami` resulted in a `503 Service Unavailable` response: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>503 Service Unavailable</title> </head><body> <h1 (truncated...)
File: /var/www/wsuls/digitalcollections/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
Line: 111
Granted the front-end can't do much without an API connection, this check should fail quietly and/or inform the user. Perhaps this is just a debug message, but still noting here.
Graham Hukill commented
Per our discussion just now, catch requests to /whoami
, flash an update, something like "couldn't determine user type", but let the page continue to try