FeatureFuel
3

Client error Interceptors

Source: appwrite/appwrite#2482 · opened by @danijel-tolj
I have been using Appwrite with Flutter for a couple of days, and I noticed a glaring issue that should be rather easy to implement.
It is the lack of flexibility when handling errors. For example, if you receive a 401, it would be nice to have an error interceptor that handles that case globally and signs you out of the app.
Right now, the solution for that would be calling account.get() to try and retrieve a session, but I find that too cumbersome and a suboptimal replacement for a simple error interceptor. What are your thoughts on this ?

My proposal would be to have something like this :

class MyInterceptor extends ErrorInterceptor{
@<!-- -->override
FutureOr<dynamic> onError(AppwriteException exception) {
if (exception.code==401) {
// Sign user out of the app
}
return exception;
}
}

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests