Skip to content
Snippets Groups Projects
Commit 76ab6be3 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[App/U] Move error message. Rewrite for spdlog.

parent 25cde10e
No related branches found
No related tags found
No related merge requests found
...@@ -362,9 +362,11 @@ static double getResolution(NcFile const& dataset, NcVar const& var) ...@@ -362,9 +362,11 @@ static double getResolution(NcFile const& dataset, NcVar const& var)
auto const bounds = (dim_var.isNull()) ? getDimLength(var, dim_idx) auto const bounds = (dim_var.isNull()) ? getDimLength(var, dim_idx)
: getBoundaries(dim_var); : getBoundaries(dim_var);
std::size_t const dim_size = var.getDim(dim_idx).getSize(); std::size_t const dim_size = var.getDim(dim_idx).getSize();
std::string const err_msg("Dimension \"" + var.getDim(dim_idx).getName() + if (dim_size == 0)
"\" has size 0. Aborting..."); {
if (dim_size == 0) return OGS_FATAL(err_msg.c_str()); OGS_FATAL("Dimension '{:s}' has size 0. Aborting...",
var.getDim(dim_idx).getName());
}
return std::fabs(bounds.second - bounds.first) / static_cast<double>(dim_size); return std::fabs(bounds.second - bounds.first) / static_cast<double>(dim_size);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment