LogoLogo
Enterprise GuideCommunity Edition GuideDeveloper Guide
  • Using The Polarity Developer Guide
  • Quick Start
    • What's New
    • Installing Integrations
    • Quick Start Guide
    • Learning Resources
  • Building an Integration
    • Directory Layout
    • package.json
    • Configuration File
    • Integration Main Module
      • startup
      • doLookup
        • Entity Objects
        • Result Objects
        • Error Objects
      • onDetails
      • onMessage
      • validateOptions
    • Customizing the Overlay Window
      • Templates
        • Conditionals
        • Displaying a List of Items
        • Display Object Properties
        • Built-in Helpers
        • Displaying Icons
      • Component File
        • Aliased Properties
        • Computed Properties
        • Event Hooks
      • CSS Styles
    • Vendor Javascript
      • Inserting Javascript into DOM
    • README Guide
    • Debugging Integrations
      • Web Inspector
      • Using Integration Logs
      • Testing Main Module
  • Recipes
    • Enabling User Actions
    • Throttling Lookups
    • Using Custom Entity Types
    • Custom Summary Tags
    • Creating a Tabbed Interface
    • Accessing Username of Requestor
Powered by GitBook
On this page
  • Error Objects
  • Basic Errors
  • Advanced Errors
  • Advanced Error Properties
  1. Building an Integration
  2. Integration Main Module
  3. doLookup

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

// 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);

PreviousResult ObjectsNextonDetails

Last updated 5 years ago