Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dawn-java-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dawn
java
dawn-java-common
Commits
a76cb1be
Commit
a76cb1be
authored
2 years ago
by
Tucker Gary Siegel
Browse files
Options
Downloads
Patches
Plain Diff
expand
parent
ceceacf6
No related branches found
Branches containing commit
Tags
0.11.0
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/edu/umd/dawn/common/exceptions/CustomExceptionHandler.java
+18
-3
18 additions, 3 deletions
...du/umd/dawn/common/exceptions/CustomExceptionHandler.java
with
18 additions
and
3 deletions
src/main/java/edu/umd/dawn/common/exceptions/CustomExceptionHandler.java
+
18
−
3
View file @
a76cb1be
...
@@ -51,6 +51,11 @@ public class CustomExceptionHandler {
...
@@ -51,6 +51,11 @@ public class CustomExceptionHandler {
return
returnDawnException
(
wrapped
);
return
returnDawnException
(
wrapped
);
}
}
private
ResponseEntity
<
Object
>
wrapExceptionAs
(
Exception
exception
,
DawnExceptionParameters
parameters
)
{
DawnException
wrapped
=
new
DawnException
(
parameters
,
exception
);
return
returnDawnException
(
wrapped
);
}
@ExceptionHandler
(
BindException
.
class
)
@ExceptionHandler
(
BindException
.
class
)
protected
ResponseEntity
<
Object
>
handleBindException
(
BindException
ex
,
WebRequest
request
)
{
protected
ResponseEntity
<
Object
>
handleBindException
(
BindException
ex
,
WebRequest
request
)
{
...
@@ -68,14 +73,24 @@ public class CustomExceptionHandler {
...
@@ -68,14 +73,24 @@ public class CustomExceptionHandler {
ArrayIndexOutOfBoundsException
exception
,
WebRequest
webRequest
)
{
ArrayIndexOutOfBoundsException
exception
,
WebRequest
webRequest
)
{
return
wrapExceptionAs
(
exception
,
BaseExceptions
.
OUT_OF_BOUNDS
);
return
wrapExceptionAs
(
exception
,
BaseExceptions
.
OUT_OF_BOUNDS
);
}
}
@ExceptionHandler
(
DawnException
.
class
)
public
ResponseEntity
<
Object
>
handleDawnExceptions
(
DawnException
exception
,
WebRequest
webRequest
)
{
return
returnDawnException
(
exception
);
}
@ExceptionHandler
(
RuntimeException
.
class
)
@ExceptionHandler
(
RuntimeException
.
class
)
public
ResponseEntity
<
Object
>
handleUnHandledException
(
RuntimeException
exception
,
WebRequest
webRequest
)
{
public
ResponseEntity
<
Object
>
handleUnHandledException
(
RuntimeException
exception
,
WebRequest
webRequest
)
{
return
wrapExceptionAs
(
exception
,
BaseExceptions
.
UNHANDLED_INTERNAL_SERVER_ERROR
);
return
wrapExceptionAs
(
exception
,
BaseExceptions
.
UNHANDLED_INTERNAL_SERVER_ERROR
);
}
}
@ExceptionHandler
(
DawnException
.
class
)
@ExceptionHandler
(
Exception
.
class
)
public
ResponseEntity
<
Object
>
handleDawnExceptions
(
DawnException
exception
,
WebRequest
webRequest
)
{
public
ResponseEntity
<
Object
>
handleUnHandledException
(
Exception
exception
,
WebRequest
webRequest
)
{
return
returnDawnException
(
exception
);
return
wrapExceptionAs
(
exception
,
BaseExceptions
.
UNHANDLED_INTERNAL_SERVER_ERROR
);
}
@ExceptionHandler
(
Throwable
.
class
)
public
ResponseEntity
<
Object
>
handleUnHandledException
(
Throwable
exception
,
WebRequest
webRequest
)
{
return
wrapExceptionAs
((
Exception
)
exception
,
BaseExceptions
.
UNHANDLED_INTERNAL_SERVER_ERROR
);
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment