I suggest making LogPrintf
noexcept
, but before doing so note that the following call chain is triggered here (also before this PR):
LogPrintStr
→ LogTimestampStr
→ FormatISO8601DateTime
→ strprintf
Generally strprintf
may throw tinyformat::format_error
.
In the case of the call FormatISO8601DateTime
I don’t think that is possible since the format string is well formed. However, that is not understood by the compiler which currently must assume that FormatISO8601DateTime
can throw.
I suggest handling the (non-reachable) tinyformat::format_error
explicitly in FormatISO8601DateTime
and then making that function noexcept
too. (Should be done also for its companion FormatISO8601Date
).
So in summary my suggestion is to:
- Handle
tinyformat::format_error
in FormatISO8601DateTime
and FormatISO8601Date
- Add
noexcept
to FormatISO8601DateTime
, FormatISO8601Date
and LogPrintf