mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[client,sdl] add SDL_Error to exceptions
This commit is contained in:
@@ -73,7 +73,8 @@
|
||||
class ErrorMsg : public std::exception
|
||||
{
|
||||
public:
|
||||
ErrorMsg(int rc, Uint32 type, const std::string& msg);
|
||||
ErrorMsg(int rc, Uint32 type, const std::string& msg,
|
||||
const std::string& sdlError = SDL_GetError());
|
||||
|
||||
[[nodiscard]] int rc() const;
|
||||
[[nodiscard]] const char* what() const noexcept override;
|
||||
@@ -82,6 +83,7 @@ class ErrorMsg : public std::exception
|
||||
int _rc;
|
||||
Uint32 _type;
|
||||
std::string _msg;
|
||||
std::string _sdlError;
|
||||
std::string _buffer;
|
||||
};
|
||||
const char* ErrorMsg::what() const noexcept
|
||||
@@ -94,10 +96,11 @@ int ErrorMsg::rc() const
|
||||
return _rc;
|
||||
}
|
||||
|
||||
ErrorMsg::ErrorMsg(int rc, Uint32 type, const std::string& msg) : _rc(rc), _type(type), _msg(msg)
|
||||
ErrorMsg::ErrorMsg(int rc, Uint32 type, const std::string& msg, const std::string& sdlError)
|
||||
: _rc(rc), _type(type), _msg(msg), _sdlError(sdlError)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << _msg << " {" << sdl::utils::toString(_type) << "}";
|
||||
ss << _msg << " {" << sdl::utils::toString(_type) << "}{SDL:" << sdlError << "}";
|
||||
_buffer = ss.str();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user