Skip to content
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

ErrorHandlerService should be use on every server request #212

Open
leomendoza123 opened this issue May 20, 2020 · 1 comment
Open

ErrorHandlerService should be use on every server request #212

leomendoza123 opened this issue May 20, 2020 · 1 comment
Assignees
Labels
bug Something isn't working feature

Comments

@leomendoza123
Copy link
Member

leomendoza123 commented May 20, 2020

Let's make sure all calls to the backend pipe the ErrorHandlerService and do the retry(3) if an error is thrown.

This requires us to fix the following endpoints, and make sure all other server calls catch errors with this service.

getDiscoFeed(): Observable<Institutional[]> {
return this._http.get<Institutional[]>(
environment.BASE_URL + 'Shibboleth.sso/DiscoFeed'
)
}

and

private getConfig() {
return this._http.get<Config>(environment.API_WEB + 'config.json', {
withCredentials: true,
})
}

@leomendoza123 leomendoza123 changed the title Use of ErrorHandlerService should be use on every server request ErrorHandlerService should be use on every server request May 20, 2020
@leomendoza123
Copy link
Member Author

An instance of correct use is

public checkDuplicatedResearcher(names: {
familyNames: string
givenNames: string
}) {
return this._http
.get<DuplicatedName[]>(environment.API_WEB + `dupicateResearcher.json`, {
params: names,
withCredentials: true,
})
.pipe(
retry(3),
catchError((error) => this._errorHandler.handleError(error))
)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature
Projects
None yet
Development

No branches or pull requests

2 participants