-
Notifications
You must be signed in to change notification settings - Fork 45
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
Howto retry request #179
Comments
Hi @bluewalk Thank you for warm words :) But I think you can try to call $handleErrorResponse(options: IResourceActionInner, resp: IResourceResponse): any {
this.loader.complete();
switch (resp.status) {
case 401:
if (this._authservice.refresh()) {
console.log('gotta retry request, but how?');
return this.$restAction(options); // hope it will help you
}
break;
case 403:
this._authservice.logout();
break;
}
if (options.returnData && this.$_canSetInternalData(options)) {
options.returnData.$resolved = true;
}
if (options.actionAttributes.onError) {
options.actionAttributes.onError(resp);
}
} Let me know if that will help you. |
I was thinking of something like that as well, unfortunately it doesn't work: The methods are |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First of all, great work, saves a bunch of work on my side 👍
What I'm unable to figure out is how to retry a request.
For example I have the following, a class that extends Resource which overrides
After refreshing the bearer token (which returns a boolean) I would like to re-execute the original request so the user doesn't have to click the button twice.
How would I go and achieve that? Is there a way to send the original request back to
this.requestHandler
? Or is there some other way?Below the handleErrorResponse method
The text was updated successfully, but these errors were encountered: