mirror of
https://github.com/glest/glest-source.git
synced 2025-08-20 23:21:19 +02:00
- added support for throwing known errors and skipping stack traces (For friendlier error messages)
This commit is contained in:
@@ -29,8 +29,12 @@ using std::exception;
|
||||
namespace Shared { namespace Platform {
|
||||
|
||||
class megaglest_runtime_error : public runtime_error {
|
||||
protected:
|
||||
bool noStackTrace;
|
||||
public:
|
||||
megaglest_runtime_error(const string& __arg);
|
||||
megaglest_runtime_error(const string& __arg,bool noStackTrace=false);
|
||||
|
||||
bool wantStackTrace() const { return noStackTrace; }
|
||||
};
|
||||
|
||||
#ifndef WIN32
|
||||
|
@@ -256,8 +256,8 @@ string PlatformExceptionHandler::getStackTrace() {
|
||||
return errMsg;
|
||||
}
|
||||
|
||||
megaglest_runtime_error::megaglest_runtime_error(const string& __arg)
|
||||
: std::runtime_error(__arg + PlatformExceptionHandler::getStackTrace()) {
|
||||
megaglest_runtime_error::megaglest_runtime_error(const string& __arg,bool noStackTrace)
|
||||
: std::runtime_error(noStackTrace ? __arg + PlatformExceptionHandler::getStackTrace() : __arg), noStackTrace(noStackTrace) {
|
||||
}
|
||||
|
||||
}}//end namespace
|
||||
|
@@ -265,8 +265,8 @@ string PlatformExceptionHandler::getStackTrace() {
|
||||
return result;
|
||||
}
|
||||
|
||||
megaglest_runtime_error::megaglest_runtime_error(const string& __arg)
|
||||
: std::runtime_error(__arg + PlatformExceptionHandler::getStackTrace()) {
|
||||
megaglest_runtime_error::megaglest_runtime_error(const string& __arg,bool noStackTrace)
|
||||
: std::runtime_error(noStackTrace ? __arg + PlatformExceptionHandler::getStackTrace() : __arg), noStackTrace(noStackTrace) {
|
||||
}
|
||||
|
||||
// =====================================================
|
||||
|
Reference in New Issue
Block a user