Skip to content

Prevent OSJS from Crashing on Uncaught Exceptions by Handling Errors Gracefully #854

@maryam4s26

Description

@maryam4s26

hello @andersevenrud
In certain cases, some unhandled errors in the program are causing OS.js to crash unexpectedly. To improve the stability and prevent the entire system from going down due to unhandled exceptions, it might be beneficial to implement a global error handler.

For example, by adding the following code to the beginning of src/server/index.js, we can log the error without crashing OS.js:

process.on('uncaughtException', (error) => {
  console.log(error);
});

This approach would ensure that the server continues running even if an uncaught exception occurs, allowing us to log and address the issue without interrupting service.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions