Standardize exceptions for Java