ApiError
A class in Alta.Api.DataTransferModels, Alta.Api.DataTransferModels.Errors.
Error body returned by the Alta web API: message, error code, request validation errors and optional context.
- Listed in Alta.Api.DataTransferModels
- Derived types
NotFoundApiError
Constructors
| Member | What it is |
|---|---|
ApiError(ErrorCode errorCode, string message) | Creates an ApiError with default values. |
ApiError(ErrorCode errorCode, string message, object context) | Creates an ApiError with default values. |
ApiError(string message) | Creates an ApiError with default values. |
ApiError() | Creates an ApiError with default values. |
Properties
| Member | What it is |
|---|---|
object Context { get; set; } | Extra data about the error, if any. |
ErrorCode ErrorCode { get; set; } | Error code (error_code in JSON). |
string Message { get; set; } | Error message. |
ValidationResultModel RequestModelErrors { get; set; } | Per-field validation errors when the request body was invalid. |
Methods
| Member | What it is |
|---|---|
static ApiError MakeForModelValidationError(ValidationResultModel validationResult) | Builds an InvalidRequestModel error with the message "Bad API Request" and the given validation errors. |
override string ToString() | The message, followed by the request errors if there are any. |
static ApiError Verbose(ErrorCode errorCode, string verboseError) | Builds an error with a code and a detailed message. |
Used in
Members of other types that take, return or hold a ApiError: