[MRESOLVER-63] FileTransformer#transformData(File) should also throw TransformException#23
Conversation
rfscholte
left a comment
There was a problem hiding this comment.
Thanks for picking this up so fast! Have a look at the comments and let's see if this can be improved soon.
| * Thrown when file transformation failed. | ||
| */ | ||
| public class FileTransformationException | ||
| extends RepositoryException |
There was a problem hiding this comment.
This is not really a repository exception. Consider the following usecase: we want to transform the pom.xml during upload with xslt. When trying to generate the XMLParser you must catch the SaxException. This one should be wrapped and thrown by this method.
There was a problem hiding this comment.
Good point, thanks for the explaination and prompt review. The exception now inherits directly from Exception.
| * | ||
| * @param file The file which transformation failed, may be {@code null}. | ||
| */ | ||
| public FileTransformationException( File file ) |
There was a problem hiding this comment.
There's not always a file involved yet, no need to use this.
| * @return the transformed data | ||
| */ | ||
| InputStream transformData( File file ) throws IOException; | ||
| InputStream transformData( File file ) throws FileTransformationException; |
There was a problem hiding this comment.
Both IOException and TransformException must be thrown. Better not make it too explicit, we might do other transformations as well in the future, not only filebased.
There was a problem hiding this comment.
Included TransformException in the throws clause.
d949d89 to
26abf0e
Compare
|
If you want you can add yourself as a contributor in the pomfile as well. |
…TransformException
26abf0e to
30cc467
Compare
|
@rfscholte PR updated, added contributor section to pom.xml. |
|
Resolve #844 |
1 similar comment
|
Resolve #844 |
Up-for-grabs #DevoxxBE