FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
example-postgresql/src/ErrorHandler.cpp at master · oatpp/example-postgresql · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
oatpp
/
example-postgresql
Public
Notifications
You must be signed in to change notification settings
Fork
20
Star
41
Code
Issues
7
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
example-postgresql
/
src
/
ErrorHandler.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (16 loc) · 673 Bytes
Breadcrumbs
example-postgresql
/
src
/
ErrorHandler.cpp
Copy path
File metadata and controls
24 lines (16 loc) · 673 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
include
"
ErrorHandler.hpp
"
ErrorHandler::ErrorHandler
(
const
std::shared_ptr<oatpp::data::mapping::ObjectMapper>& objectMapper)
: m_objectMapper(objectMapper)
{}
std::shared_ptr<ErrorHandler::OutgoingResponse>
ErrorHandler::handleError
(
const
Status& status,
const
oatpp::String& message,
const
Headers& headers) {
auto
error =
StatusDto::createShared
();
error->
status
=
"
ERROR
"
;
error->
code
= status.
code
;
error->
message
= message;
auto
response =
ResponseFactory::createResponse
(status, error, m_objectMapper);
for
(
const
auto
& pair : headers.
getAll
()) {
response->
putHeader
(pair.
first
.
toString
(), pair.
second
.
toString
());
}
return
response;
}
Back
|
FazBrowse Home
|
New Git URL