45 fmt::format_error format_exception_builder(
46 std::string_view function_call,
47 std::string_view what,
48 const std::string &fmt_string,
49 std::source_location loc) {
52 "format failed:\n function={}\n what={}\n fmt_string={}",
59 static shambase::call_lambda register_format_exception_builder([]() {
Call a lambda at static or local scope construction time.
This header file contains utility functions related to exception handling in the code.
void set_format_exception_builder(format_except_builder_t callback)
Install a custom builder for format exceptions.
namespace for basic c++ utilities
std::string fmt_callstack()
Get the formatted callstack.
void set_exception_gen_callback(exception_gen_callback_t callback)
Set the exception generator callback.
std::string exception_format(SourceLocation loc)
Format the exception message with the source location information.
void(* exception_print_callback)(std::string msg)
exception print callback func ptr
void(*)(std::string msg) exception_gen_callback_t
type of the exception generator callback
void exception_gen_callback(std::string msg)
The callback called when an exception is thrown.
exception_gen_callback_t get_exception_gen_callback()
Get the current exception generator callback.
ExcptTypes make_except_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Create an exception with a message and a location.
This file contains the definition for the stacktrace related functionality.
provide information about the source location
std::string format_multiline() const
format the location in multiple lines