-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
Description
All jspoon's conversion exceptions extend too broad RuntimeException and provide only the error message with no information about what field or class caused it.
For example, if you use Jspoon together with Retrofit2 like I do, and want to somehow handle converter exception you have to check for 6 different exception types in onFailure()
@Override
public void onFailure(Call<MyAwesomeRepo> call, Throwable t) {
if ((t instanceof NumberFormatException) || (t instanceof DateParseException)
|| (t instanceof BigDecimalParseException) || (t instanceof DoubleParseException)
|| (t instanceof FloatParseException) || (t instanceof FieldSetException)) {
// all I can do is only log the original message anyway
logger.error(e.getMessage());
}
}