Skip to content

Try + Catch User Auth Flutter Dart #4867

Answered by ganigeorgiev
rodnnnney asked this question in Q&A
Discussion options

You must be logged in to vote

Seems like [] operator can't be applied on the error object.

I don't understand what do you mean by this.

This is not PocketBase specific but to catch a specific error you can use either is if check inside the catch block or directly filter it before the catch:

try {
  ...
} on ClientException catch(e) {
  // e.response["data"]
}

In general for all available exception fields you can refer to Error handling or the class reference.

If you are still not able to resolve your issue, please paste the exact error.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rodnnnney
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants