Format Java Backend Exceptions#1777
Conversation
783696a to
92374af
Compare
|
@Mythicaeda will do some smoke testing of this against the current version of the UI to make sure the new message format is fully supported |
|
Discussed this one with @Mythicaeda yesterday and we realized that the endpoints used by Hasura queries (listed in |
1d4c1f7 to
0280ffd
Compare
- Replaces ExceptionSerializers
…PermissionsException - rename "PermissionsServiceException" to "GraphQLServiceException" for clarity
- Update Workspaces to process single PermissionsException
…lidJsonEntityException InvalidJsonException was only a wrapper around JsonParsingException
- Was just a wrapper around the `MissionModelLoader` version of the exception - Removing it means the Interface MissionModelService does not have to import its implementation
0280ffd to
cb29393
Compare
| SchedulingCompilationError.schedulingErrorJsonP.unparse(ex.errors)); | ||
| } | ||
|
|
||
| public SchedulerFormattedError(DatabaseException ex) { |
There was a problem hiding this comment.
Should this be a db exception or a scheduling exception since the service here is still the scheduler?
There was a problem hiding this comment.
I have it under the main service's exception because a DatabaseException is thrown specifically when the service has a networking issue with the DB. If there's an actual issue with the transaction (for example, no rows are returned from the lookup or an insert fails), then a different exception type is thrown (ie NoSuchPlanException, FailedInsertException).
There was a problem hiding this comment.
Oh wait right, the service here is merlin server.. is it odd to be hitting scheduling (since that is where the request is ultimately running) and get "service = merlin, db exception"? Or is that the right way? I guess whatever it is we should be consistent about it when we have these interacting services (you likely already are doing this, just talking out loud).
There was a problem hiding this comment.
Oh the service being MERLIN_SERVICE is a typo, lemme fix that
Description
This PR does three things:
extensionsobjectNumber 2) is accomplished by pulling FormattedError out into the
parsing-utilslibrary, then creating service-specific subclasses to handle service-specific exceptions.Verification
E2E Tests were updated to reflect the updates to the error messages.
I did some manual tests with the UI. In these tests, I started a debugger in the backend with a breakpoint set at the start of the Hasura Action Handler code. After submitting the request via the UI, I would go in and remove data from the database to force the backend pre-checks to fail. I'd then resume the backend and observe that 1) the backend was sending the information correctly and 2) how the UI was parsing the response.
What I observed was:
extensionsobjectextensionsobject and is able to extractdata,service, andtimestampout of it. It's unclear if it's using the top-levelmessagefield or the one in theextensionsobject, but that doesn't matter since they contain the same string.typefield out of theextensionsobject, instead using a genericERRORtype. Thetypefield is present inextensionsobjectLOGStab rather than being sorted into the correct category.Example:
Server Response:
{ "errors": [ { "extensions": { "data": { "specification_id": 659 }, "message": "Could not check permissions on scheduling specification 659: specification does not exist.", "service": "aerie_permissions", "timestamp": "2026-05-18T16:10:49.084229462Z", "trace": <TRACE REMOVED BY ME FOR CONCISENESS>, "type": "NO_SUCH_SCHEDULING_SPECIFICATION" }, "message": "Could not check permissions on scheduling specification 659: specification does not exist." } ] }UI Logs:

Documentation
Future work