Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
format_exception.cpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
15
17
18namespace sham {
19
23
25 std::string_view function_call,
26 std::string_view what,
27 const std::string &fmt_string,
28 std::source_location loc) {
30 return internal_func_ptr_make_format_exception(function_call, what, fmt_string, loc);
31 } else {
32 return sham::format_error(std::string(what));
33 }
34 }
35
39
43
44} // namespace sham
Core formatting functions: format, vformat, and format_printf.
namespace for backends this one is named only sham since shambackends is too long to write
void set_format_exception_builder(format_except_builder_t callback)
Install a custom builder for format exceptions.
fmt::format_error format_error
Alias for fmt::format_error, the exception type thrown by format errors.
Definition aliases.hpp:35
format_except_builder_t internal_func_ptr_make_format_exception
sham::format_error make_format_exception(std::string_view function_call, std::string_view what, const std::string &fmt_string, std::source_location loc=std::source_location::current())
Create a format error exception.
sham::format_error(*)( std::string_view, std::string_view, const std::string &, std::source_location) format_except_builder_t
Type alias for a custom format exception builder function.
format_except_builder_t get_format_exception_builder() noexcept
Get the current format exception builder.