forked from xrowgmbh/rest-bundle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UserException class and catch subscription exceptions
- Loading branch information
Andy Caiger
committed
May 24, 2017
1 parent
f96ae98
commit 3ed9b25
Showing
4 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
/* | ||
* Exception that will be passed to the OIDC client. | ||
*/ | ||
|
||
namespace xrow\restBundle\Exception; | ||
|
||
class UserException extends \Exception | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Notes for developers | ||
|
||
## Exceptions | ||
|
||
If you want an error message to be returned to the API client, throw the `UserException` exception. | ||
|
||
use xrow\restBundle\Exception\UserException; | ||
|
||
... | ||
|
||
throw(new UserException('My error has occurred')); | ||
|
||
The error message and stack trace will also be logged. | ||
|
||
Take care not to expose secure information to the client! |