SDK

Error reporting

Errors your game reports through the SDK appear in an error log on your developer dashboard. Open Errors on a game to see them.

Report errors automatically

await OpenArcade.init({ captureErrors: true });

With captureErrors, the SDK reports uncaught errors (window.onerror) and unhandled promise rejections. It does not change how errors behave in your game.

Report errors yourself

try {
  loadLevel(7);
} catch (e) {
  OpenArcade.captureError(e);
  showMessage('This level could not be loaded.');
}

OpenArcade.captureError('Save data was in an unknown format');

captureError accepts an Error or a string, never throws and resolves to { ok, sent }.

Add context

OpenArcade.setGameContext({ level: 7, mode: 'hard', build: '1.2.0' });

The context (about 1KB at most) is added to every later report. Pass null to clear it. Do not include personal data, chat text or tokens.

The error log

ColumnMeaning
ErrorThe message. Open it to see the stack trace and context
CountHow many times it was reported
Last seenThe most recent report
VersionThe version the latest report came from
DeviceDesktop or mobile, for the latest report

Reports with the same message and the same first line of the stack trace (ignoring numbers and line positions) are grouped. Up to 200 different errors are kept for each game; after that, new kinds of errors are dropped until you clear the log. Clear reports removes them all.

Reports come from published games, private previews and the SDK test game. Query strings are removed from web addresses in stack traces. Reports never include who the player is.

Limits

  • Messages up to 500 characters and stack traces up to 4,000 characters; longer text is cut.
  • 30 reports per minute from one game frame, and 30 per minute per player or network on the server. Extra reports are dropped.

Good practice

  • Report errors you cannot recover from, not expected conditions such as a player going offline.
  • Keep messages stable. A message containing changing values (Failed at 12:04:31) groups badly; put those values in the context.
  • Ship source maps only if you are happy for players to read your source. Stack traces show whatever your build contains.