MCPcopy Create free account
hub / github.com/cutelyst/cutelyst / finalizeError

Method finalizeError

Cutelyst/enginerequest.cpp:60–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void EngineRequest::finalizeError()
61{
62 Response *res = context->response();
63
64 res->setContentType("text/html; charset=utf-8"_ba);
65
66 QByteArray erroBody;
67
68 // Trick IE. Old versions of IE would display their own error page instead
69 // of ours if we'd give it less than 512 bytes.
70 erroBody.reserve(512);
71
72 erroBody.append(context->errors().join(u'\n').toUtf8());
73
74 res->setBody(erroBody);
75
76 // Return 500
77 res->setStatus(Response::InternalServerError);
78}
79
80void EngineRequest::finalize()
81{

Callers

nothing calls this directly

Calls 5

responseMethod · 0.80
setContentTypeMethod · 0.80
setStatusMethod · 0.80
setBodyMethod · 0.60
errorsMethod · 0.45

Tested by

no test coverage detected