diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index 550e314c..c93b82ed 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -90,6 +90,7 @@ template void format_value(basic_buffer &buffer, const T &value) { internal::FormatBuf format_buf(buffer); std::basic_ostream output(&format_buf); + output.exceptions(std::ios_base::failbit | std::ios_base::badbit); output << value; buffer.resize(buffer.size()); }