LTE Beacon: Micro-app error reference

Error handling in micro-apps can be performed with standard JavaScript try ... catch, for example:

var RECORD_ID_MY_DATA = 0;
var myData = {foo: 'bar'};
try {
  storage.save(RECORD_ID_MY_DATA, myData);
} catch (error) {
  if (error.code === 'ESR0202') { // ESR0202 = No storage space
    print('out of space');
    // free up some space, then retry storage.save
  } else {
    cloud.enqueue('storage-save-error', {code: error.code});
  }
}

Here we try to save some data to beacon’s persistent memory. In the event of an error, we check the error code to determine if it’s an “out of space” error, or something else. Based on the outcome, our app can take an appropriate action: for example, maybe it can remove some unused or less important data. Or, if this is not an “out of space”, report the error to the cloud.

All errors are objects which look somewhat like this:

{code: 'ESR0202',
 message: 'ESR0202 No storage space'}

You can also register a “global” error handler, to have any uncaught errors delivered to it:

app.setErrorHandler((type, error) => {
  print('uncaught error: ' + error.message);
  cloud.enqueue('uncaught-error', {code: error.code});
});

Below is a list of all documented errors.

System errors

ESR0001 Unknown error

Source of error cannot be determined

ESR0002 Reboot loop detected.

Device started rebooting itself in a loop. To prevent this app was stopped.

ESR0003 Unsupported feature.

Required feature is unsupported on this hardware version.

ESR0004 Not enough resources

There are not enough resources (like timers or advertisers) to perform operation. Make sure you released all resource handles (eg. setting them to null) and stopped advertisers.

ESR0005 Time is not valid

Current system time is not synchronised yet and its value is incorrect. It will be synchronised during next Cloud sync via LTE or when using GNSS.

ESR0006 Deprecated function

This function is deprecated. Use other function instead. It may be removed in future releases.

VM errors

ESR0101 Internal VM error

Internal assertion caused JS VM to throw fatal error. VM and app will be restarted.

ESR0102 Out of VM memory

Out of virtual machine heap memory, VM and app will be restarted. Try to reduce object size. Make sure you have no soft memory leaks.

ESR0103 VM executed too long

User code executed for longer than 10s and was interrupted. Probably caused by infinite loop.

ESR0104 Execution interrupted

Execution was interrupted by another app being uploaded and installed.

ESR0105 Out of slot execution

VM code was executed as it was running as native.

Storage errors

ESR0201 Storage error

Storage system is not able to persistently save data. Probably it is overloaded with requests.

ESR0202 No storage space

Storage system is full. You need remove user data and/or synchronize device with Cloud.

ESR0203 Not serializable

Provided object cannot be converted to stream of bytes because it contains not serializable elements like handles or functions

ESR0204 Message too big

Message is too big to be stored. Reduce message size by removing unnecessary elements and using more compact data structures.

ESR0205 Data store timeout

Waiting for previous message to be stored has timed out. Consider less frequent storage write operations.

Modem errors

ESR0401 Modem unknown error

Not able to pin point source of an modem error

ESR0402 Modem timeout

Modem was processing command for more than maximum expected time.

ESR0403 Modem command error

Modem responded with an error, but was not kind enough to provide an error code.

ESR0404 Modem init error

Modem initialization procedure have failed. Try again.

ESR0405 SIM card error/missing

SIM card is missing or is damaged. Check if it sits properly in the slot.

ESR0406 Modem too low voltage

Battery voltage is too low to allow modem to work properly. Please charge the device.

ESR0407 Modem forced stop

Modem was forced to stop currently processed command by hardware reboot.

ESR0410 Airplane mode is on

Airplane mode is on and all radio operations are forbidden.

ESR0411 Invalid tech: %d

Invalid radio access technology value.

ESR0412 Invalid bandplan

Invalid bandplan enum or wrongly constructed bands object.

ESR0415 Not registrered

Modem was unable to register with cellular network. You may try again later.

ESR0416 Initial config failed

Modem initial config failed. Try again.

ESR0413 Modem unlisted error: %d

Not able to find a error text for that internal code.

Function call errors

ESR0601 Bad args

Number or type of arguments does not match function signature

ESR0602 New operation

Previous async operation is still pending and there can be only one operation in progress. Previous promise has been rejected.

ESR0603 JS error:

JavaScript generic error. Please refer to ECMA Script documentation.

Cloud synchronization errors

ESR0701 Registration timeout

Modem was unable to register in cellular network

ESR0702 Firmware check failed

Device was unable to check for firmware update.

ESR0703 Modem fatal error

Modem stopped to respond to commands.

ESR0704 Request failed

Synchronization request to the server failed. There might be some problems with infrastructure or Cloud.

ESR0705 Sync timeout

Synchronization takes too much time and will be forcefully stopped. It is probably some internal error.

Type conversion errors

ESR0502 Bad value %s %d

Provided value is out of range of supported values.

ESR0503 Value out of enum range

Provided value is out of supported values defined by enum object. Try to use enum object instead of raw values.

ESR0504 Value is not valid interval

Provided interval string is invalid.

ESR0510 Odd char number

Trying to convert hex-encoded string, but it has odd number of characters

ESR0511 Not hex character

Trying to convert hex-encoded string, but one of the characters is not hex: 0-9 A-F

GNSS errors

ESR1202 minInterval longer than timeout: %d > %d

Minimal reporting interval is smaller than location process timeout value. It means it was set to finish before it even began.

ESR1203 Position not found

GNSS subsystem was not able to obtain geographical position with provided options

BLE errors

ESR1501 Scan start error: %d

Device is unable to scan for BLE packets

ESR1505 Invalid UUID len

UUID for iBeacon is longer or shorter than 16 bytes

ESR1506 Invalid ID len

Invalid identifier length. It is longer or shorter.

UWB errors

ESR1701 Bad args for role

Given arguments are not valid for selected UWB role.

ESR1703 Invalid options

Invalid UWB configuration options. Check in documentation.