opensim-creator icon indicating copy to clipboard operation
opensim-creator copied to clipboard

Change error log messages to be more visible

Open adamkewley opened this issue 3 years ago • 1 comments

Estimate: 2-3d

OpenSim Creator tries to keep alive as long as possible during typical use. This is so that the user's progress is always available. Therefore, we can't afford to completely kill the application when an exception comes along.

A common way of "swallowing" exceptions in osc is to sink them into the log, fix any state errors, and continue on as normal. E.g.:

try
{
    doSomethingThatThrows();
}
catch (std::exception const& ex)
{
    log::error("uh oh: %s", ex.what());
    tryToFixCurrentStateAsMuchAsPossible();
}

The problem is that the log is a very crude way of showing runtime errors. The user might not have the log open, and error messages might be mixed with info messages.

A more robust solution would be to implement something like ReportErrorToUser, which initially just log::errors the error, but eventually will do stuff like drawing an error message overlay in the top-right of the screen or something.

adamkewley avatar Feb 01 '22 15:02 adamkewley

This relates to #83 , which had to swallow an exception somewhere. It felt gross but it's the best it can do in that situation.

adamkewley avatar Feb 01 '22 15:02 adamkewley