You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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());
}
}
The text was updated successfully, but these errors were encountered:
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()
The text was updated successfully, but these errors were encountered: