Skip to main content
Version: 5.11.4

OnTooManyRequestByLocalError

Description

This handler is called automatically when requests are sent even after being restricted from the server due to excessive requests, such as making at least 1 call per second.
The handler is called when the following error is returned:

When excessive requests continue
statusCode : 403
errorCode : Forbidden

Example

Main thread

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

Backend.ErrorHandler.OnTooManyRequestByLocalError = () => {
Debug.Log("403 local error occurred!!!");
gameObject.GetComponentInChildren<Text>().text = "Excessive requests.";
};
}
}

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

External thread

void Start() {
Backend.ErrorHandler.OnTooManyRequestByLocalError = () => {
Debug.Log("403 local error occurred!!!");
};
}