# 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"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devdocs.olisystems.com/error-output.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
