Skip to content
Snippets Groups Projects

LORD2: Catch global application errors

Closed Eugene So requested to merge eso/sbbs:eugeneso/lord2_errorhandling into master

Add try-catch error handler to main application code to avoid crashing sbbs if a door error occurs.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Why would a JS exception in lord2 cause "sbbs to crash"? Please elaborate.

    -Rob

  • Author Developer

    I can test in further detail. However, what I found is when the application was not catching overall exceptions, this door would randomly stop working and it would result in sbbs also halting. After adding the try-catch loop, the door still occasionally crashes, but now sbbs remains operational and we can then use the error-log from the door return result to debug the issue.

  • Yes, please provide more details. It would be highly unusual for a crashing JS application to result in sbbs also halting. If the application (lord2.js in this case) is invoked as an external program, configured in SCFG->External Programs->Online Programs, that should not be able to happen. Additionally, setting the "Use Shell or New Context" option to 'Yes' should prevent any misbehaving JS application from corrupting the JS runtime used by the BBS (e.g. for command shells, etc.).

  • Author Developer

    I'm unable to reproduce the sbbs crash unfortunately. The computer that it originally happened on had a bad hard disk, so that may have been part of the problem. In any case, I still think it's a good idea to wrap the application in a try-catch.

  • assigned to @Deuce

  • Maintainer

    Synchronet effectively wraps JS doors in a try/catch already (along with a new global and some other niceties). This try/catch would only serve to lower the amount of information about the error.

  • closed

Please register or sign in to reply
Loading