diff options
author | Ed Tanous <edtanous@google.com> | 2021-12-01 23:50:35 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2021-12-10 21:40:56 +0300 |
commit | df5415fc03b458eedfcb07a6be262d1067a50aec (patch) | |
tree | 5f2d7a93599d7268b1d8daa70da70346b5aba7c1 /redfish-core/lib/task.hpp | |
parent | f523c3246920e8be6320f9c761f6c975c61c9e0d (diff) | |
download | bmcweb-df5415fc03b458eedfcb07a6be262d1067a50aec.tar.xz |
Add logging to internal error
Internal error call sites are propagated through the code, and might be
triggered multiple times in the course of a request, which makes them
difficult to track the source of.
This commit changes the internalError() method to include a print of
which invocation within bmcweb triggered the error, using c++20s
std::source_location mechanism.
Note:
clang-13 still doesn't implement std::source_location, so this commit
pulls source_location.hpp from lg2 to be able to support all compilers.
Tested:
Loaded in qemu, and added an internalError() call into systems.hpp for
the /redfish/v1/Systems handler. Observed that
[CRITICAL "error_messages.cpp":234] Internal Error
../../../../../../workspace/sources/bmcweb/redfish-core/include/../lib/systems.hpp(2820:40)
`redfish::requestRoutesSystemsCollection(App&)::<lambda(const
crow::Request&, const std::shared_ptr<bmcweb::AsyncResp>&)>`:
Got printed to the bmcweb logs.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic1b4240422445357bc87404de814ad14f86b9edf
Diffstat (limited to 'redfish-core/lib/task.hpp')
0 files changed, 0 insertions, 0 deletions