-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interceptor return types are incorrect. #158
Comments
I'm looking in to this now to see if the description is correct or the docs are incorrect, either way I will tidy this one up. |
Ok sorry looks like |
I'm experiencing an issue related to the return types in a typescript project. The docs, under Basic Http Interceptors, show that you can 'throw error' for requestError and responseError, but this does not compile due to the type definitions expecting the return type to be For example, the following interceptor... export class MyInterceptor implements Interceptor {
responseError(error: HttpResponseMessage) {
throw error;
}
} results in...
I can fix this by changing However, doing the same for requestError would look like... export class MyInterceptor implements Interceptor {
requestError(error: Error) {
return Promise.reject<RequestMessage>(error);
}
} Is that right? |
Any movement regarding this topic? |
All of the documentation for the fetch client needs to be refreshed. The API docs are incomplete and the example usage here is also possibly incorrect: http://aurelia.io/docs/plugins/http-services#aurelia-fetch-client |
Would you like to provide a pull request for it @djensen47 ? |
I need to figure out how the project documentation works. I probably won't be able to get to that for a few days/weeks. |
I could point you in right direction. (-: |
Thanks! How do the API docs work? I think that has the bigger issue of no documentation. Or at the very least, I would start with the API docs, then make sure that the guide is correct (or if I have to eat my hat 😉 🍽 🎩 ). |
Api docs are automated in collecting annotations. Mostly. |
@bigopon maybe can be closed |
The return types should match the fetch spec, in particular the
requestError
andresponseErrors
should have valid return types (they do not appear to from what I can tell)The text was updated successfully, but these errors were encountered: