Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improved message for mismatched type exception
  • Loading branch information
ajs6f committed Mar 18, 2014
1 parent 7f5a343 commit cb541f1
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -55,9 +55,11 @@ public TransformationFactory() {
// this suppression is in place representing the condition that the generator
// map actually maps the mimetypes proffered to legitimate Transformations for those mimetype
public <T> Transformation<T> getTransform(final MediaType contentType, final InputStream inputStream) {
if (mimeToTransform.containsKey(contentType.toString())) {
final String mimeType = contentType.toString();
if (mimeToTransform.containsKey(mimeType)) {
return (Transformation<T>) mimeToTransform.get(contentType.toString()).newTransform(inputStream);
}
throw new UnsupportedOperationException("No transform type exists for that media type!");
throw new UnsupportedOperationException(
"No transform type exists for media type" + mimeType + "!");
}
}

0 comments on commit cb541f1

Please sign in to comment.