File Information
Library: RemotingNG/REST
Package: REST
Header: Poco/RemotingNG/REST/RESTServerException.h
Description
This exception class contains detailed information from a REST error received from the server.
Inheritance
Direct Base Classes: Poco::RemotingNG::RemoteException
All Base Classes: Poco::Exception, Poco::LogicException, Poco::RemotingNG::RemoteException, Poco::RemotingNG::RemotingException, std::exception
Member Summary
Member Functions: className, clone, content, detail, error, name, operator =, reason, rethrow, status
Inherited Functions: className, clone, code, displayText, extendedMessage, message, name, nested, operator =, rethrow, what
Constructors
RESTServerException
RESTServerException(
const RESTServerException & exc
);
Creates a new RESTServerException from another one.
RESTServerException
RESTServerException(
const std::string & reason,
int status,
JSValue::Ptr pDetail
);
Creates a RESTServerException with the given reason, HTTP status code and detail.
RESTServerException
RESTServerException(
const std::string & reason,
const std::string & message,
int status,
JSValue::Ptr pContent
);
Creates a RESTServerException with the given reason, message, HTTP status code and detail.
Destructor
~RESTServerException
~RESTServerException() noexcept;
Destroy the exception.
Member Functions
className
const char * className() const noexcept;
Returns the name of the exception class.
clone
Poco::Exception * clone() const;
Creates an exact copy of the exception.
content
JSValue::Ptr content() const;
Returns the JSON content of the server response.
detail
std::string detail() const;
Returns the value of the content's "detail" property if it exists, otherwise an empty string.
error
std::string error() const;
Returns the value of the content's "error" property if it exists, otherwise an empty string.
name
const char * name() const noexcept;
Returns a static string describing the exception.
operator =
RESTServerException & operator = (
const RESTServerException & exc
);
Assignment operator.
reason
const std::string & reason() const;
Returns the HTTP reason text of the server response.
rethrow
void rethrow() const;
(Re)Throws the exception.
status
int status() const;
Returns the HTTP status code of the server response.