Created
May 18, 2012 16:25
-
-
Save joshbirk/2726213 to your computer and use it in GitHub Desktop.
Apex REST Error Handling
This file contains hidden or 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
| RestResponse res = RestContext.response; | |
| res.addHeader('Error','This is an Error'); | |
| res.StatusCode = 400; | |
| return null; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And the result would be:
{u'body': u'', u'headers': {'date': 'Fri, 18 May 2012 16:23:04 GMT', 'status': '400', 'content-length': '0', 'server': '', 'error': 'This is an Error'}}