/** * Deserialize the rawAdditionalContext from a UserException into a new AdditionalExceptionContext. * * @param ex A UserException containing serialized AdditionalExceptionContext data. * @return A new AdditionalExceptionContext of the serialized type. */ public static InvalidMetadataErrorContext fromUserException(UserException ex) { Preconditions.checkState(ex.getErrorType() == ErrorType.INVALID_DATASET_METADATA, "exception type mismatch"); return JsonAdditionalExceptionContext.fromUserException(InvalidMetadataErrorContext.class, ex); } }