onError method
Called when an exception was occurred during the request.
Implementation
@override
void onError(DioException err, ErrorInterceptorHandler handler) async {
if (err.response?.statusCode == 401) {
/// Handle token refresh or session management
await _handleTokenRefresh();
}
super.onError(err, handler);
}