You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building my own adapter with typescript, and I use tsc -b to build it.
Since the new routing change, I get a type error when building (see reproduction).
Also: HttpError and Redirect classes are not available to import, which they probably should be since we indirectly throw them and might want to handle them differently if thrown around with other errors.
Also also, not directly related but still weird typing issue: I had to add @types/estree to dependencies to appease svelte, seems related to: sveltejs/svelte#3397
For what it's worth, I support exposing these. "You can throw it but you can't catch it" seems kind of like an antipattern. Even better, an export like isRedirect/isHttpError so that we can maintain encapsulation of those classes:
exportconstisRedirect=(err: unknown): err is Redirect=>{/* implementation */}
Is there any other recommended way to catch an HttpError? A fetch request to my backend API can throw HttpErrors and Redirects. I'd like to handle errors and throw Redirects but I don't see a way to do this as of now.
Describe the bug
I'm building my own adapter with typescript, and I use
tsc -b
to build it.Since the new routing change, I get a type error when building (see reproduction).
Also:
HttpError
andRedirect
classes are not available to import, which they probably should be since we indirectly throw them and might want to handle them differently if thrown around with other errors.See also Rich's comment here: #5952 (comment)
Also also, not directly related but still weird typing issue: I had to add
@types/estree
to dependencies to appease svelte, seems related to: sveltejs/svelte#3397Reproduction
https://stackblitz.com/edit/node-sfis81?file=index.ts
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: