3 #include <msp/strings/lexicalcast.h>
9 #include "systemerror.h"
15 system_error::system_error(const string &w, int c):
16 runtime_error(w+": "+get_message(c)),
20 system_error::system_error(const string &w, const string &e):
21 runtime_error(w+": "+e),
22 code_(numeric_limits<int>::min())
25 string system_error::get_message(int c)
32 if(FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, 0, c, 0, msg, sizeof(msg), 0))
35 return lexical_cast<string>(c, Fmt().hex());