Created
July 2, 2016 04:53
-
-
Save loind89/b03f5594f567a8ba65f04ea3c19f444e to your computer and use it in GitHub Desktop.
Response Json from sprign boot exception handler for servelet exception
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
| // this default json object that default spring boot have handling | |
| // in @Controller ( java code ) | |
| throw new ServletException("Invalid login"); | |
| // response json | |
| { | |
| "data": { | |
| "timestamp": 1467434876215, | |
| "status": 500, | |
| "error": "Internal Server Error", | |
| "exception": "javax.servlet.ServletException", | |
| "message": "Invalid login", | |
| "path": "/user/login" | |
| }, | |
| "status": 500, | |
| "config": { | |
| "method": "POST", | |
| "transformRequest": [ | |
| null | |
| ], | |
| "transformResponse": [ | |
| null | |
| ], | |
| "url": "/user/login", | |
| "data": { | |
| "name": "sds" | |
| }, | |
| "headers": { | |
| "Accept": "application/json, text/plain, */*", | |
| "Content-Type": "application/json;charset=utf-8" | |
| } | |
| }, | |
| "statusText": "Internal Server Error" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment