Skip to content

Handle FatalErrors in Java Lab - #48061

Merged
fisher-alice merged 2 commits into
stagingfrom
javalab_fatal_error
Sep 15, 2022
Merged

Handle FatalErrors in Java Lab#48061
fisher-alice merged 2 commits into
stagingfrom
javalab_fatal_error

Conversation

@fisher-alice

@fisher-alice fisher-alice commented Sep 12, 2022

Copy link
Copy Markdown
Contributor

This PR handles FatalErrors in Java Lab. Currently for fatal errors, the fatal error message is printed (default case). This may be confusing to users in that FatalErrors are typically not related to their program (out of memory, out of disk space, etc).
This will update the message to 'Oops. We hit an error on our side...'.

Links

jira ticket - Handle FatalErrors in Java Lab

Testing story

I ran javabuilder locally and forced a fatal error by adding the following to line 115 in WebSocketServer.java:

throw new FatalError(FatalErrorKey.LOW_DISK_SPACE);

I also tested with the other two fatal errors. Below is the screencast video when javabuilder is run locally.

fatalerrortests.mp4

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@fisher-alice
fisher-alice marked this pull request as ready for review September 14, 2022 20:56
@fisher-alice
fisher-alice requested review from a team and sanchitmalhotra126 September 14, 2022 20:56

@molly-moen molly-moen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! If we end up adding more fatal errors we may want to generalize the key so we don't need to keep updating this list :)

@sanchitmalhotra126 sanchitmalhotra126 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

INTERNAL_RUNTIME_EXCEPTION: 'INTERNAL_RUNTIME_EXCEPTION',
INVALID_CLASS: 'INVALID_CLASS',
INVALID_JAVA_FILE_NAME: 'INVALID_JAVA_FILE_NAME',
INVALID_MAIN_METHOD: 'INVALID_MAIN_METHOD',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for alphabetizing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants