# Error Objects

## **Error Objects**

### Basic Errors

### **Advanced Errors**

If the error parameter is a string then the string value will be displayed in the notification window for the user that requested the lookup. In the event that you want to return more error details than can be reasonably captured in a string you should return an array of JSON API error objects keyed by `errors` in the top level of the return error object. A JSON API error object consists of the following properties:

### Advanced Error Properties

#### **detail**

required | *string*

A human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.

**status**

optional | *string*

The HTTP status code applicable to this problem, expressed as a string value.

**title**

optional | *string*

A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.

**code**

optional | *string*

An application-specific error code, expressed as a string value.

**meta**

optional | *object*

A meta object containing non-standard meta-information about the error.

The following is an example error object

```javascript
// Example of returning JSON API formatted errors
// Note the single error object must be returned as an array keyed 
// on `errors`.
let jsonApiErrors = {
    errors: [{
        detail: "This is an error message",
        status: '400',
        title: '',
        code: '978',
        meta:{
          stackTrace: ''
        }    
    }]
};

cb(jsonApiErrors);
```

##


---

# 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://docs.polarity.io/integrations/build-an-integration/main/dolookup/error-objects.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.
