Skip to main content
Version: 5.11.4

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

When the project status in BACKND Console is 'Maintenance'(upon calling functions other than login)
statusCode : 401
errorCode : BadUnauthorizedException

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