Uh oh!
There was an error while loading. Please reload this page.
Add OCS Middleware - #475
Conversation
mention-bot
commented
Jul 20, 2016
@rullzer, thanks for your PR! By analyzing the annotation information on this pull request, we identified @BernhardPosselt, @DeepDiver1975 and @nickvergessen to be potential reviewers |
| @@ -0,0 +1,83 @@ | |||
| <?php | |||
| /** | |||
There was a problem hiding this comment.
Mmm I just ran the license script. Will fix.
LukasReschke
commented
Jul 20, 2016
I like it 👍 |
| * @return OCSResponse | ||
| */ | ||
| public function afterException($controller, $methodName, \Exception $exception) { | ||
| if ($controller instanceof OCSController) { |
There was a problem hiding this comment.
I'd probably combine the if with the next if. That way you nest one level less which makes it much more readable
There was a problem hiding this comment.
Ah fair enough. Leftover from when I did not have the generic Exception yet. Will fix.
BernhardPosselt
commented
Jul 20, 2016
Except for merging the two ifs I don't see anything that can be improved. If implemented 👍 |
* OCSException * OCSBadRequestException * OCSForbiddenException * OCSNotFoundException
rullzer
commented
Jul 20, 2016
Comments fixed. |
…ion-handling fix(notifications): Notifier::prepare() threw \InvalidArgumentExcepti…
This adds OCSMiddleware so apps that use OCSController have some control about the special way OCS works.
There is the generic OCSException and for now 3 speciailized exceptions for more type safety.
Also deprecated the old \OCP\API
Of course unit tests are added.
CC: @LukasReschke@nickvergessen@MorrisJobke@BernhardPosselt