# Error models

Based on response [HTTP status code](https://developers.portos.sk/http-status-codes), one of following error models are returned in response body.

## ProblemDetails

A machine-readable format for specifying errors in HTTP API responses based on <https://tools.ietf.org/html/rfc7807>.

<table><thead><tr><th width="162.66666666666666">Name</th><th width="192">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>string?</code></td><td>A URI reference [RFC3986] that identifies the problem type.</td></tr><tr><td><code>title</code></td><td><code>string?</code></td><td>A short, human-readable summary of the problem type.</td></tr><tr><td><code>status</code></td><td><code>int?</code></td><td>The HTTP status code([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.</td></tr><tr><td><code>detail</code></td><td><code>string?</code></td><td>A human-readable explanation specific to this occurrence of the problem.</td></tr><tr><td><code>instance</code></td><td><code>string?</code></td><td>A request URI path.</td></tr><tr><td><code>traceId</code></td><td><code>string?</code></td><td>Unique identifier to represent this request in trace logs.</td></tr><tr><td><code>errorCode</code></td><td><code>int?</code></td><td><a href="error-codes">API error code</a>, if applicable.</td></tr><tr><td><code>resource</code></td><td><a href="#resourceinfo"><code>ResourceInfo?</code></a></td><td>Information about resource present in request. Available when errorCode is <a href="../error-codes#6-resourceversionmismatch">6 (Version mismatch)</a></td></tr></tbody></table>

## PortosValidationProblemDetails

This class inherits all properties from [`ProblemDetails`](#problemdetails), and adds properties listed below:

<table><thead><tr><th width="108.99999999999997">Name</th><th width="414">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>errors</code></td><td><a href="#portosvalidationproblemdetailserror"><code>PortosValidationProblemDetailsError[]</code></a></td><td>Collection of errors. Each element represents one broken validation rule. </td></tr></tbody></table>

## PortosValidationProblemDetailsError

<table><thead><tr><th width="231.99999999999997">Name</th><th width="232">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>memberName</code></td><td><code>string</code></td><td>Property name.</td></tr><tr><td><code>message</code></td><td><code>string</code></td><td>Message that describes error.</td></tr><tr><td><code>code</code></td><td><code>string?</code></td><td>One of <a href="validation-constraints">validation constraints</a>, if applicable.</td></tr></tbody></table>

## ResourceInfo

<table><thead><tr><th width="209.99999999999997">Name</th><th width="142">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>string</code></td><td><a href="resource-names">Resource name</a></td></tr><tr><td><code>id</code></td><td><code>string</code></td><td>Unique resource identifier</td></tr><tr><td><code>version</code></td><td><code>int?</code></td><td>Resource version</td></tr></tbody></table>
