arrow_back
logo
search
SupportlaunchAPI
menulaunchSign In
close
OverviewConceptsAdmin PanelCloudAPICompliance
Overview
Get StartedAuthorizationMessagingJackpotsMultiplayerGame Client InterfaceErrors Handle
Get StartedAuthorizationGame SessionMessagingBettings and WinningsRandom Numbers GeneratorJackpotsMultiplayerTesting
Overview
Overview
Using the client libraryImplementing an integrationDeploying an integration
Replying to a gamePending Winnings
.NET CoreGoJavaNodeJsPHPPythonRuby
OverviewOverwriting jackpots
launchAPISupport
launchSign In

Errors Handle

Errors Responses

Every request send to fireball can return an ErrorResponse message. There are main errors types:

  • Timeout Error - can indicate lost connection with Fireball Server or internal Server errors (crashes, exception e.t.c).
  • Integration Errors (Rejects) - errors like authenticate-reject, bet-place-rejected, jackpot-pay-rejected e.t.c - means not allowed actions for integration side due to different reason (wrong provided parameters, IDs, not enough money on balance, operator integration internal errors e.t.c)
  • In-Game errors - errors sent by Game Server to the Client for different reasons - validation error, wrong action, game internal exception e.t.c
  • Other Errors - other errors that can be occurred in Fireball system
if (errorResponse.IsTimeout)
{
    // handle timeout
    Debug.LogError($"Error: Timeout - {errorResponse.Reason}");
}
else
{
    // handle error by name
    Debug.LogError($"Error: {errorResponse.Name} - {errorResponse.Reason}");
}

Some errors can contain updated Balance for different situation when manipulation with Players balance are failed:

if (errorResponse.Balance != null)
{
    // update game balance
    _game.UpdateBalance(errorResponse.Balance.Value);
}

Error Dialogs

Some errors may contain the ErrorDialog object with additional details about the error dialogue for the game client.

  1. Check error has a dialogue
if (errorResponse.HasDialog)
{
     // show error dialogue
     ShowErrorDialogue(errorResponse.Error.Dialog);
}
  1. Update error dialogue texts
public Text _dialogTitle;
public Text _dialogMessage;

public void ShowErrorDialogue(ErrorDialog dialog)
{
    // set error data into dialogue
    _dialogTitle.text = dialog.Title;
    _dialog.text = dialog.Message;

    // set dialogue buttons
    SetErrorButtons(dialog.Buttons);
}
  1. Set dialogue button actions by checking errorButton.Action field in ErrorDialogButton list
  • Action type OK - click on button means just close error dialogue and allows player to continue play
  • Action type Reload - click on button means quit and reload (restart) the game fully
  • Action type Retry - click on button means send same request again
  • Action type Redirect - click on button means quit the game and go to the webpage
  • Action type ClientScript - means send GCI operator error event to the operator page (more)
  • Action type Home - means quit the game and go to the home page
public BaseRequest _lastRequest;
public RectTransform _dialogue;
public List<Button> _dailogButton;

public void SetErrorButtons(List<ErrorDialogButton> buttons)
{
    for (int i = 0; i < buttons.Count; i++)
    {
        _dailogButton[i].GetComponentInChildren<Text>().text = buttons[i].Text;

        switch (buttons[i].Action)
        {
            case DialogButtonAction.OK:
                _dailogButton[i].onClick.AddListener(() =>
                {
                    // close dialogue
                    _dialogue.gameObject.SetActive(false);
                });
                break;

            case DialogButtonAction.Reload:
                _dailogButton[i].onClick.AddListener(() =>
                {
                    // reload game
                    WebBrowser.ReloadPage();
                });
                break;

            case DialogButtonAction.Retry:
                _dailogButton[i].onClick.AddListener(() =>
                {
                    // resend same request
                    _fireball.ResendLastRequest();
                });
                break;

            case DialogButtonAction.Redirect:
                _dailogButton[i].onClick.AddListener(() =>
                {
                    // open provided link
                    WebBrowser.SetLocation(buttons[i].Link);
                });
                break;

            case DialogButtonAction.ClientScript:
                _dailogButton[i].onClick.AddListener(() =>
                {
                    // send integration error to the operators page
                    _fireball.GameClientInterface.SendIntegrationError(buttons[i].ClientScript.Value);
                });
                break;

            case DialogButtonAction.Home:
                _dailogButton[i].onClick.AddListener(() =>
                {
                    // go home page if it provided
                    _fireball.GoHomePage();
                });
                break;
        }
    }
}
Copyright © 2020-. All rights reserved.v1.0.8