Poco::RemotingNG::REST

class RESTServerException

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 virtual

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 inline

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 virtual

const char * name() const noexcept;

Returns a static string describing the exception.

operator =

RESTServerException & operator = (
    const RESTServerException & exc
);

Assignment operator.

reason inline

const std::string & reason() const;

Returns the HTTP reason text of the server response.

rethrow virtual

void rethrow() const;

(Re)Throws the exception.

status inline

int status() const;

Returns the HTTP status code of the server response.

Securely control IoT edge devices from anywhere   Connect a Device