Skip to main content
Version: SDK-5.11.6

OnMaintenanceError

Description

This handler is automatically called when a method is called after changing the project status to 'Maintenance' via [BACKND Console - Server Settings - Project].
The handler is called when the following error is returned:

When the project status in BACKND Console is 'Maintenance'(upon login)
statusCode : 401
errorCode : BadUnauthorizedException
message : bad serverStatus: maintenance, Invalid serverStatus: maintenance

When the project status in BACKND Console is 'Maintenance'(upon calling functions other than login)
statusCode : 401
errorCode : BadUnauthorizedException
message : bad bad,serverStatus:,maintenance,,Invalid serverStatus:,maintenance, Invalid bad,serverStatus:,maintenance,,Invalid serverStatus:,maintenance

Example

Main thread

void Start() {
if(Backend.IsInitialized) {
Backend.ErrorHandler.InitializePoll(true);

Backend.ErrorHandler.OnMaintenanceError = () => {
Debug.Log("Maintenance error occurred!!!");
gameObject.GetComponentInChildren<Text>().text = "Under maintenance.";
};
}
}

void Update() {
if(Backend.ErrorHandler.UseAsyncQueuePoll) {
Backend.ErrorHandler.Poll();
}
}

External thread

void Start() {
Backend.ErrorHandler.OnMaintenanceError = () => {
Debug.Log("Maintenance error occurred!!!");
};
}
```js