Skip to content

Latest commit

 

History

History
93 lines (70 loc) · 3.8 KB

api.md

File metadata and controls

93 lines (70 loc) · 3.8 KB

Classes

AioCoreSDKError

The base class for all Adobe I/O Core SDK Errors.

Functions

createUpdater(codes, messages)function

Returns a function that updates the parameters specified. This is used in ErrorWrapper.

ErrorWrapper(errorClassName, sdkName, updater, baseClass)function

Returns a function that will dynamically create a class with the error code specified, and updates the objects specified via the Updater parameter.

The returned function takes two parameters:

  • code (string), which is the error code.
  • message (string), which is the error message (can contain format specifiers)

AioCoreSDKError

The base class for all Adobe I/O Core SDK Errors.

Kind: global class

new AioCoreSDKError([message], [code], [sdk], [sdkDetails], [captureStackTrace])

Constructor. Do not instantiate directly, subclass this class instead.

Param Type Default Description
[message] string "<no_message>" The message for the Error
[code] string "<unknown_code>" The code for the Error
[sdk] string "<unknown_sdk>" The SDK associated with the Error
[sdkDetails] object {} The SDK details associated with the Error
[captureStackTrace] boolean Error.captureStackTrace if available, capture the V8 stack trace

aioCoreSDKError.toJSON() ⇒ object

Returns a JSON respresentation of this Error object.

Kind: instance method of AioCoreSDKError
Returns: object - this error object as json

createUpdater(codes, messages) ⇒ function

Returns a function that updates the parameters specified. This is used in ErrorWrapper.

Kind: global function
Returns: function - an updater function

Param Type Description
codes object.<string, Error> an object that will map an error code to an Error class.
messages Map.<string, string> a Map, that will map the error code to an error message

ErrorWrapper(errorClassName, sdkName, updater, baseClass) ⇒ function

Returns a function that will dynamically create a class with the error code specified, and updates the objects specified via the Updater parameter.

The returned function takes two parameters:

  • code (string), which is the error code.
  • message (string), which is the error message (can contain format specifiers)

Kind: global function
Returns: function - a wrapper function

Param Type Description
errorClassName string The class name for your SDK Error. Your Error objects will be these objects
sdkName string The name of your SDK. This will be a property in your Error objects
updater createUpdater the object returned from a createUpdater call
baseClass Error the base class that your Error class is extending. AioCoreSDKError is the default