> For the complete documentation index, see [llms.txt](https://devdocs.olisystems.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devdocs.olisystems.com/error-output.md).

# Error/Warning output

If a computation fails in the API, the JSON response will look like the one below. The **data.error** object contains any **errors (data.error.error)** or **warnings (data.error.warning)** caught during the computation.

```javascript
{
  "code": 200,
  "data": {
    "error": {
      "error": {
        "messages": [
          {
            "code": 1001,
            "message": [
              "the equilibrium calculation failed to converge"
            ]
          },
          {
            "code": 1001,
            "message": [
              "the T, P calculation did not converge"
            ]
          }
        ]
      },
      "warning": {
        "messages": [
          {
            "code": 1001,
            "message": [
              "the maximum number of iterations were exceeded"
            ]
          }
        ]
      }
    }
  },
  "message": "Results returned successfully",
  "status": "SUCCESS"
}
```

| error.\[error/warning].messages\[ { } ] | type      | description           |
| --------------------------------------- | --------- | --------------------- |
| code                                    | number    | simulation error code |
| message                                 | \[string] | error message lines   |

Sometimes its also possible that the computation will succeed and return with the **data.result** object. But inside this object we may have **data.result.error** and/or **data.result.warning** object.&#x20;

```javascript
{
  "code": 200,
  "data": {
    "result": {
      ...<snip>...
      "error": {
        "error": {
          "messages": [
            {
              "code": 1001,
              "message": [
                "the equilibrium calculation failed to converge"
              ]
            },
            {
              "code": 1001,
              "message": [
                "the T, P calculation did not converge"
              ]
            }
          ]
        },
        "warning": {
          "messages": [
            {
              "code": 1001,
              "message": [
                "the maximum number of iterations were exceeded"
              ]
            }
          ]
        }
      }
    }
  },
  "message": "Results returned successfully",
  "status": "SUCCESS"
}
```
