errorListener - Initialization - Reports API

Reports API Initialization


This function is called when one of the preset Learnosity API errors are thrown.

You would want to define this callback so that you can display your own error message or track the error in your own error reporting systems, for example.


var callbacks = {
    errorListener: function (errorEvent) {
        console.log('The callback that is executed when a Learnosity API error occurs.');

        /* For example, providing an invalid report type will throw:
                "code": 10003,
                "msg": "Report type not supported"
    // ...


  • errorEvent object

    An object containing information on the error or error event that was thrown by the API. See Reports API Troubleshooting for a full list of error codes.

    • code number

      The Learnosity error code returned by the API.

    • msg string

      The name and description of the error event.

    • detail string

      Additional information for the error that was thrown. May not always be returned depending on the error.

Return value

None (undefined).

Related articles

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.