catch java.lang.Error when calling sdf