mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-11-30 10:59:00 +00:00
30 lines
659 B
C++
30 lines
659 B
C++
#ifndef RAYLIB_CPP_INCLUDE_RAYLIBEXCEPTION_HPP_
|
|
#define RAYLIB_CPP_INCLUDE_RAYLIBEXCEPTION_HPP_
|
|
|
|
#include <stdexcept>
|
|
|
|
#include <string>
|
|
|
|
#include "raylib.h"
|
|
|
|
namespace raylib {
|
|
class RaylibException : public std::runtime_error {
|
|
protected:
|
|
public:
|
|
RaylibException(std::string msg) throw() : std::runtime_error(msg) {
|
|
// Nothing
|
|
}
|
|
|
|
/**
|
|
* Outputs the exception message to TraceLog().
|
|
*
|
|
* @param logLevel The output status to use when outputing.
|
|
*/
|
|
void TraceLog(int logLevel = LOG_ERROR) {
|
|
::TraceLog(logLevel, std::runtime_error::what());
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif // RAYLIB_CPP_INCLUDE_RAYLIBEXCEPTION_HPP_
|