There are a few places where we use std::runtime_error for out exception handling. This is fine for the most part but we could be a LOT cleaner with it in order to make logging much easier.
Things that need to be done
[ ] Serialization for most of the classes (see core/logging.hpp) All that needs to be done here is just to define the specializations for each class that we might need. Ideally we would do this last since it'll be easier to figure out classes that we should specialize.
[ ] Better notifications. We already have a few dummy notification handlers (userwarn/devwarn). User warn should just be a simple warning for the user. Basically just remake MessageNotification with some scary coloring.
[ ] Pivot all spdlog::warn and spdlog::error to userwarn and devwarn respectively. Which THEN should call spdlog for our file logging. Dev warn will require the serialization for the classes we wish to error out. Dev warn should allow the user to copy the json we serialize and send it into a place like discord or a github issue
[ ] Custom exceptions for difference components. It should inherit from std::exception as all exceptions should. Inherit exceptions deep to make them able to be used in a generic sense (IE catching ANY db error. Or a specific one).
[ ] Any catch(...) should abort and vocally error instead of cleanly handling itself. In this case we've done something seriously wrong and aren't catching the right things. Generic catches should be frowned upon.
There are a few places where we use
std::runtime_error
for out exception handling. This is fine for the most part but we could be a LOT cleaner with it in order to make logging much easier.Things that need to be done
core/logging.hpp
) All that needs to be done here is just to define the specializations for each class that we might need. Ideally we would do this last since it'll be easier to figure out classes that we should specialize.catch(...)
should abort and vocally error instead of cleanly handling itself. In this case we've done something seriously wrong and aren't catching the right things. Generic catches should be frowned upon.