namespace folly {
+class BadFormatArg : public std::invalid_argument {
+ public:
+ explicit BadFormatArg(const std::string& msg)
+ : std::invalid_argument(msg) {}
+};
+
/**
* Parsed format argument.
*/
template <typename... Args>
inline void FormatArg::error(Args&&... args) const {
- throw std::invalid_argument(errorStr(std::forward<Args>(args)...));
+ throw BadFormatArg(errorStr(std::forward<Args>(args)...));
}
template <bool emptyOk>