errorListener - Initialization - Author API

Author 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 invalid security details will throw:
                "code": 41000,
                "msg": "Missing security parameters"

    // ...

var authorApp = window.LearnosityAuthor.init(


  • error object

    Object containing error details.

    • code number

      The Learnosity error code returned by the API.

    • message string

      Message containing information about the error.

    • status boolean

      The error status which will always be false, indicating a failed operation.

    • timestamp number

      Returns time (in milliseconds) when the error occurred.

Return value

None (undefined).

Related articles

Was this article helpful?

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