X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fsystemerror.cpp;h=1ccee74ed4a80139c77e1e013567465f4325906e;hp=6d1d876c1f3e00fb94886a1612454af7443bf01a;hb=4418103963cca2b68fd2dbf6d1d16eeebc8b3c40;hpb=6a38983c19fe78753962288e206c5817ad595448 diff --git a/source/core/systemerror.cpp b/source/core/systemerror.cpp index 6d1d876..1ccee74 100644 --- a/source/core/systemerror.cpp +++ b/source/core/systemerror.cpp @@ -5,6 +5,7 @@ #include #include #endif +#include #include "systemerror.h" using namespace std; @@ -16,6 +17,11 @@ system_error::system_error(const string &w, int c): code_(c) { } +system_error::system_error(const string &w, const string &e): + runtime_error(w+": "+e), + code_(numeric_limits::min()) +{ } + string system_error::get_message(int c) { #ifdef WIN32 @@ -26,7 +32,7 @@ string system_error::get_message(int c) if(FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, 0, c, 0, msg, sizeof(msg), 0)) return msg; else - return lexical_cast(c, Fmt().hex()); + return lexical_cast(c, Fmt().hex()); #else if(c==-1) c = errno;