Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
AoU-Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
AoU
AoU-Backend
Merge requests
!172
feat: reply with HttpStatus 400 and SAX messsage on metadata parsing exception
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
feat: reply with HttpStatus 400 and SAX messsage on metadata parsing exception
MVO-400-with-SAX-message
into
master
Overview
0
Commits
1
Pipelines
0
Changes
3
Merged
Mathieu.Vonlanthen
requested to merge
MVO-400-with-SAX-message
into
master
4 years ago
Overview
0
Commits
1
Pipelines
0
Changes
3
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
9ee7a1ba
1 commit,
4 years ago
3 files
+
51
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
AoU-Common/src/main/java/ch/unige/aou/controlleradvice/AoUControllerAdvice.java
0 → 100644
+
34
−
0
Options
package
ch.unige.aou.controlleradvice
;
import
static
ch
.
unige
.
solidify
.
controller
.
SolidifyControllerAdvice
.
StackTraceDisplay
.
WITH_STACK_TRACE
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.boot.web.servlet.error.ErrorAttributes
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
ch.unige.solidify.controller.SolidifyControllerAdvice
;
import
ch.unige.solidify.repository.SolidifyError
;
import
ch.unige.solidify.service.MessageService
;
import
ch.unige.aou.exception.AoUMetadataParseException
;
@ControllerAdvice
public
class
AoUControllerAdvice
extends
SolidifyControllerAdvice
{
public
AoUControllerAdvice
(
ErrorAttributes
errorAttributes
,
MessageService
messageService
)
{
super
(
errorAttributes
,
messageService
);
}
@ExceptionHandler
(
AoUMetadataParseException
.
class
)
public
ResponseEntity
<
SolidifyError
>
handleException
(
AoUMetadataParseException
exception
,
HttpServletRequest
request
)
{
String
message
=
""
;
if
(
exception
.
getCause
()
!=
null
)
{
message
=
exception
.
getCause
().
getMessage
();
}
return
this
.
buildResponse
(
exception
,
request
,
message
,
HttpStatus
.
BAD_REQUEST
,
WITH_STACK_TRACE
);
}
}
Loading