diff --git a/fmt/ostream.h b/fmt/ostream.h index ef5e2efe3008..6848aac28c2c 100644 --- a/fmt/ostream.h +++ b/fmt/ostream.h @@ -80,6 +80,7 @@ void format_arg(BasicFormatter &f, internal::FormatBuf format_buf(buffer); std::basic_ostream output(&format_buf); + output.exceptions(std::ios_base::failbit | std::ios_base::badbit); output << value; BasicStringRef str(&buffer[0], buffer.size());