super(json, TypeLiteral.get(GlacierError.class));
}
private static Exception refineException(GlacierError error, Exception exception) {
if ("AccessDeniedException".equals(error.getCode())) {
return new AuthorizationException(error.getMessage(), exception);
} else if ("InvalidParameterValueException".equals(error.getCode())) {
return new IllegalArgumentException(error.getMessage(), exception);
} else if ("LimitExceededException".equals(error.getCode())) {
return new InsufficientResourcesException(error.getMessage(), exception);
} else if ("ResourceNotFoundException".equals(error.getCode())) {