mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-05 16:33:31 +00:00
Differentiate divide by zero errors
When debugging formula problems, it is convenient to be able to pinpoint at what line in the code an exception was thrown. This commit differentiates two divide by zero errors to facilitate that.
This commit is contained in:
parent
399fd8adf9
commit
6a729df4c0
@ -409,7 +409,7 @@ variant variant::operator/(const variant& v) const
|
||||
int denominator = v.as_decimal();
|
||||
|
||||
if(denominator == 0) {
|
||||
throw type_error("divide by zero error");
|
||||
throw type_error("decimal divide by zero error");
|
||||
}
|
||||
|
||||
long long long_int = as_decimal();
|
||||
@ -432,7 +432,7 @@ variant variant::operator/(const variant& v) const
|
||||
const int denominator = v.as_int();
|
||||
|
||||
if(denominator == 0) {
|
||||
throw type_error("divide by zero error");
|
||||
throw type_error("int divide by zero error");
|
||||
}
|
||||
|
||||
return variant(numerator / denominator);
|
||||
|
Loading…
x
Reference in New Issue
Block a user