* Exception used for most raylib-related exceptions. */
| 11 | * Exception used for most raylib-related exceptions. |
| 12 | */ |
| 13 | class RaylibException : public std::runtime_error { |
| 14 | public: |
| 15 | /** |
| 16 | * Construct a runtime exception with the given message. |
| 17 | * |
| 18 | * @param message The message to provide for the exception. |
| 19 | */ |
| 20 | explicit RaylibException(const std::string& message) noexcept : std::runtime_error(message) { |
| 21 | // Nothing |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Outputs the exception message to TraceLog(). |
| 26 | * |
| 27 | * @param logLevel The output status to use when outputing. |
| 28 | */ |
| 29 | void TraceLog(int logLevel = LOG_ERROR) { ::TraceLog(logLevel, std::runtime_error::what()); } |
| 30 | }; |
| 31 | |
| 32 | } // namespace raylib |
| 33 |