mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Catch more exceptions in gnc_numeric_convert
To enable fixing https://bugs.gnucash.org/show_bug.cgi?id=798132.
This commit is contained in:
parent
04d4038e3f
commit
8e41857014
@ -1004,6 +1004,10 @@ gnc_numeric_convert(gnc_numeric in, int64_t denom, int how)
|
||||
{
|
||||
return convert(GncNumeric(in), denom, how);
|
||||
}
|
||||
catch (const std::invalid_argument& err)
|
||||
{
|
||||
return gnc_numeric_error(GNC_ERROR_OVERFLOW);
|
||||
}
|
||||
catch (const std::overflow_error& err)
|
||||
{
|
||||
return gnc_numeric_error(GNC_ERROR_OVERFLOW);
|
||||
@ -1012,6 +1016,10 @@ gnc_numeric_convert(gnc_numeric in, int64_t denom, int how)
|
||||
{
|
||||
return gnc_numeric_error(GNC_ERROR_OVERFLOW);
|
||||
}
|
||||
catch (const std::domain_error& err)
|
||||
{
|
||||
return gnc_numeric_error(GNC_ERROR_REMAINDER);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user