Commit 20147fd3 authored by Ghitha Dinan's avatar Ghitha Dinan

handle internal server error

parent 20f71e29
......@@ -81,20 +81,22 @@ class CustomExceptionHandler : ResponseEntityExceptionHandler() {
@ExceptionHandler(RuntimeException::class)
fun handleRuntimeException(ex: Exception, request: WebRequest?): ResponseEntity<Any?>? {
val response = ReturnData()
response.success = false
response.message = "Interval Server Error"
response.message = ex.message
response.message = "Terjadi kesalahan sistem. Silahkan ulangi beberapa saat lagi"
var status = HttpStatus.INTERNAL_SERVER_ERROR
if (ex is BaseException) {
response.message = "Terjadi kesalahan sistem. Silahkan ulangi beberapa saat lagi"
ex.printStackTrace()
if (ex.status != status) {
response.message = ex.message
ex.data?.let {
response.data = it
}
ex.data?.let {
response.data = it
}
status = ex.status
status = ex.status
}
} else {
return ResponseEntity(response, status)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment