EMS.ResourceAPI.EEMSHTTPError.RaiseError

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class procedure RaiseError(ACode: Integer; const AError: string = ''; const ADescription: string = ''); static;

C++

static void __fastcall RaiseError(int ACode, const System::UnicodeString AError = System::UnicodeString(), const System::UnicodeString ADescription = System::UnicodeString());

Properties

Type Visibility Source Unit Parent
procedure
function
public
EMS.ResourceAPI.pas
EMS.ResourceAPI.hpp
EMS.ResourceAPI EEMSHTTPError

Description

Raises an EEMSHTTPError exception with the specified error code, error name, and error description.

HTTP status codes for errors are 300 and above. If the specified error code is lower than 300, RaiseError raises an EAssertionFailed exception.

If the specified error code matches any of the error codes in the following table and you specify an empty string as the value of AError or ADescription, RaiseError uses the following default values instead for the Error and Description properties of the raised exception:

Code Default Error Default Description
400 Bad request The request has unexpected or missing query parameters, url segments or request body
401 Unauthorized request The credentials of the request are not authorized for the requested operation.
403 Forbidden The request is for an operation that is not allowed
404 Not found The request does not identify a known application, resource, endpoint, or entity
409 Duplicate The request is to create or rename an entity, with a name already in use

See Also