I've created a custom datasource which fetches data from a web api, and I'm now looking at implementing error handling.
In the datasource, I'm calling $model->onError(). In the model, I've created the onError method, and I can access error details with $this->getDataSource()->error;
However I can't redirect or set a flash message because that can only take place in the controller, so what should I be doing here to communicate the error to the user?