getErrorMessage method
Constructs the error message for this exception.
Implementation
String getErrorMessage({
required String exceptionType,
required double? min,
required double? max,
}) {
final StringBuffer buffer = StringBuffer(exceptionType);
if (message != null) {
buffer.write(": $message");
}
if (value != null) {
buffer.write("\n"
"\tExpected: number between $min to $max (inclusive)\n"
"\tActual: $value");
}
return buffer.toString();
}