private <T> T handleBindError(ConfigurationPropertyName name, Bindable<T> target, BindHandler handler, Context context, Exception error) { try { Object result = handler.onFailure(name, target, context, error); return context.getConverter().convert(result, target); } catch (Exception ex) { if (ex instanceof BindException) { throw (BindException) ex; } throw new BindException(name, target, context.getConfigurationProperty(), ex); } }