Add a callback function here to do whatever you want with the error information. You can add multiple or remove if you need to.
static List<OnError> onErrorMiddleware = [];