[#fmt-system_error] = xref:fmt.adoc[fmt]::system_error :relfileprefix: ../ :mrdocs: Constructs `std::system_error` with a message formatted with `fmt::format(fmt, args...)`. `error_code` is a system error code as given by `errno`. == Synopsis Declared in `<fmt/format.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename... T> std::system_error system_error( int error_code, xref:fmt/format_string.adoc[format_string<T...>] fmt, T&&... args); ---- == Description *Example*: // This throws std::system_error with the description // cannot open file 'madeup': No such file or directory // or similar (system message may vary). const char* filename = "madeup"; FILE* file = fopen(filename, "r"); if (!file) throw fmt::system_error(errno, "cannot open file '{}'", filename); == Return Value An exception type that includes an `error_code` value. [.small]#Created with https://www.mrdocs.com[MrDocs]#