mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-28 21:30:00 +01:00
Use error handler to report errors
This commit is contained in:
@@ -367,18 +367,9 @@ template <typename Char, typename AF>
|
||||
typename printf_context<Char, AF>::format_arg printf_context<Char, AF>::get_arg(
|
||||
iterator it, unsigned arg_index) {
|
||||
(void)it;
|
||||
const char *error = 0;
|
||||
format_arg arg;
|
||||
if (arg_index == std::numeric_limits<unsigned>::max()) {
|
||||
arg_index = this->next_arg_index();
|
||||
if (!error)
|
||||
arg = this->do_get_arg(arg_index, error);
|
||||
} else {
|
||||
arg = Base::get_arg(arg_index - 1, error);
|
||||
}
|
||||
if (error)
|
||||
FMT_THROW(format_error(!*it ? "invalid format string" : error));
|
||||
return arg;
|
||||
if (arg_index == std::numeric_limits<unsigned>::max())
|
||||
return this->do_get_arg(this->next_arg_index());
|
||||
return Base::get_arg(arg_index - 1);
|
||||
}
|
||||
|
||||
template <typename Char, typename AF>
|
||||
|
||||
Reference in New Issue
Block a user