Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
I
Inovasi Daerah Master
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ghitha Dinan
Inovasi Daerah Master
Commits
20147fd3
Commit
20147fd3
authored
Nov 17, 2021
by
Ghitha Dinan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle internal server error
parent
20f71e29
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
CustomExceptionHandler.kt
...novasi/daerah/master/controller/CustomExceptionHandler.kt
+6
-4
No files found.
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/controller/CustomExceptionHandler.kt
View file @
20147fd3
...
...
@@ -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
}
status
=
ex
.
status
}
}
else
{
return
ResponseEntity
(
response
,
status
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment