Skip to content

Error reference

AI Summary

A short gist of this page, generated for you.

Powered by AI. Summaries can miss nuance — when in doubt, read the page.

When an SDK call fails, its promise rejects with a FunOxSDKError that has a code and a message.

javascript
FunOxSDK.saveProgress(data).catch(function (error) {
  console.warn(error.code, error.message);
});

Your game should never stop because an SDK call failed. Catch the error and carry on.

#Codes

Code Cause What to do
NOT_INITIALIZED A call was made before init() Always call FunOxSDK.init() first
TIMEOUT The platform did not answer within 30 seconds (120 for ad calls) Continue the game; retry later
NOT_AUTHENTICATED saveProgress() with no logged-in player Save locally — see Guests
SAVE_FAILED The save could not be stored Keep the data in memory and retry later
LOAD_FAILED The save could not be read Retry, or start without a save
INVALID_DATA saveProgress() received something that is not an object Pass a plain object, not a string
DATA_TOO_LARGE The save is over 100 KB Store less
INVALID_SCORE submitScore() received something that is not a number Pass a valid number
INVALID_EVENT trackEvent() received an empty or non-string name Pass a non-empty string
SDK_DESTROYED destroy() was called while a request was pending Call init() again after destroy()
UNKNOWN_ACTION The platform does not recognize the call Make sure you load the SDK from the official URL
INTERNAL_ERROR The platform failed while handling the call Continue the game; retry later
BRIDGE_ERROR The Funox mobile app could not be reached Continue the game; retry later
UNKNOWN_ERROR The platform reported a failure without a code Continue the game; retry later
NOT_IN_IFRAME Rare: the host page disappeared mid-call Continue the game

#Ads do not use errors for "no ad"

Ad calls that simply show no ad resolve — with shown: false and a reason — instead of rejecting. See Ads → Reasons.

#A safe wrapper

If you want one place to handle failures:

javascript
function safe(promise, fallback) {
  return promise.catch(function (error) {
    console.warn('[Funox SDK]', error && error.code);
    return fallback;
  });
}

safe(FunOxSDK.loadProgress(), null).then(function (data) {
  data ? applyLoadedData(data) : startNewGame();
});