File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -40,12 +40,20 @@ class ServiceComponent {
40
40
OATPP_COMPONENT (std::shared_ptr<oatpp::data::mapping::ObjectMapper>, objectMapper);
41
41
42
42
43
- std::shared_ptr<OutgoingResponse> handleError (const Status& status, const oatpp::String& message) override {
43
+ std::shared_ptr<OutgoingResponse> handleError (const Status& status, const oatpp::String& message, const Headers& headers) override {
44
+
44
45
auto error = ErrorDto::createShared ();
45
46
error->code = 500 ;
46
47
error->error = " Unhandled Error" ;
47
48
error->message = message;
48
- return ResponseFactory::createResponse (Status::CODE_500, error, m_objectMapper.get ());
49
+
50
+ auto response = ResponseFactory::createResponse (Status::CODE_500, error, m_objectMapper.get ());
51
+
52
+ for (auto & pair : headers) {
53
+ response->putHeader (pair.first , pair.second );
54
+ }
55
+
56
+ return response;
49
57
}
50
58
51
59
};
You can’t perform that action at this time.
0 commit comments