inveniosoftware / invenio-oauthclient

Invenio module that provides OAuth web authorization support.
https://invenio-oauthclient.readthedocs.io
MIT License
6 stars 76 forks source link

handlers: quick fix for remote api handler when remote is string #202

Closed pazembrz closed 4 years ago

pazembrz commented 4 years ago

https://its.cern.ch/jira/browse/INSPIR-3317

drjova commented 4 years ago

@zzacharo in case of an error currently it's ignoring if you want to use the a different handler than the default one

zzacharo commented 4 years ago

@drjova yes in case of error there was no remote at all so we had to make some changes. Personally, I would go probably for a global default error handler so it can be used in the views where no remote is available and thus you cannot use the response_handler factory function. Then, I would remove the if remote... check from the response_handler as this was needed only to handle errors in the rest views. WDYT? Also bear in mind that @lnielsen will most probably work on this and refactor a bit the code but certainly include all the features we had agreed during our sprint :)

drjova commented 4 years ago

@zzacharo 👍 global default error handler works for us as well. It is actually how @pazembrz has implemented it, we can refactor a bit the PR to reflect this.

drjova commented 4 years ago

@zzacharo we've updated the PR

pazembrz commented 4 years ago

Ok, I had to add separate error_handler for response_handler as response_handler is called directly from views. @zzacharo @drjova

ppanero commented 4 years ago

Closing in favour of #205