Handle custom error class in error UI boundary

Hey guys, I am throwing a custom error
throw new GQLError(workout.message, workout.__typename);
throw new GQLError(workout.message, workout.__typename);
in a subpage. I then try to handle it using a error UI boundary. Everything works as expected but
const isGQLError = error instanceof GQLError;
const isGQLError = error instanceof GQLError;
inside of error.tsx is always false. I assume nextjs internally handles/wraps the error. Is there a way to get a hold of the thrown error directly in order to display different UI in case of an GQLError? Thank you in advance
0 Replies
No replies yetBe the first to reply to this messageJoin