-
Notifications
You must be signed in to change notification settings - Fork 5
Exceptions & Exception Handling in NAS2D
NAS2D defines a number of objects that are thrown when exceptions occur. These are derived from std::runtime_error()
and are used to allow the end user to catch certain types of recoverable errors.
filesystem_backend_init_failure
Thrown when the Filesystem is unable to initialize itself.
filesystem_not_initialized
Thrown when any Filesystem function is called before the Filesystem::init()
is called.
filesystem_already_initialized
Thrown when Filesystem::int()
is called when the Filesystem is already initialized.
filesystem_file_handle_still_open
Thrown when the Filesystem tries to close a file handle but the operation fails.
image_bad_data
Thrown when an Image resource contains an invalid pixel buffer.
image_null_data
Thrown when an Image resource contains no data in its pixel buffer.
image_unsupported_bit_depth
Thrown when attempting to load or perform operations on an image file in an 8-bit or 16-bit format.
mixer_backend_init_failure
Thrown when a derived Mixer type is unable to initialize itself.
renderer_no_glsl
OpenGL Renderer throws this when no GLSL shading language is available.
renderer_backend_init_failure
Thrown when a derived Renderer type is unable to initialize itself.
renderer_window_creation_failure
Thrown when a window context can't be created.
renderer_opengl_context_failure
OpenGL Renderer throws this when an OpenGL context can't be created.