sts_api_exception_handler
1321 ワード
api応答エラー
response code : 400
1. ParentCustomException extends RuntimeException
2. ChildCustomException extends ParentCustomException
3. ExceptionErrorData
4. ExceptionHandler extends ResponseEntityExceptionHandler
5. throw exception
Map<String, object> data = new HashMap<>();
data.put("key1", "val1");
data.put("key2", "val2");
throw new ChildException(ChildException.NOT_FOUND_DATA, data);
6. expected result ...
response code : 400
{
"result" : false,
"msg" : "NOT_FOUND_DATA",
"data" : {
"key1" : "val1",
"key2" : "val2"
}
}
Reference
この問題について(sts_api_exception_handler), 我々は、より多くの情報をここで見つけました https://velog.io/@jina_lee/stsexceptioncustom2テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol