maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MRESOLVER-63) FileTransformer#transformData(File) should also throw TransformException
Date Wed, 14 Nov 2018 16:49:00 GMT

    [ https://issues.apache.org/jira/browse/MRESOLVER-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16686853#comment-16686853
] 

ASF GitHub Bot commented on MRESOLVER-63:
-----------------------------------------

rfscholte commented on a change in pull request #23: [MRESOLVER-63] FileTransformer#transformData(File)
should also throw TransformException
URL: https://github.com/apache/maven-resolver/pull/23#discussion_r233527820
 
 

 ##########
 File path: maven-resolver-api/src/main/java/org/eclipse/aether/transform/FileTransformationException.java
 ##########
 @@ -0,0 +1,79 @@
+package org.eclipse.aether.transform;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+
+import org.eclipse.aether.RepositoryException;
+
+/**
+ * Thrown when file transformation failed.
+ */
+public class FileTransformationException
+        extends RepositoryException
 
 Review 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.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> FileTransformer#transformData(File) should also throw TransformException
> ------------------------------------------------------------------------
>
>                 Key: MRESOLVER-63
>                 URL: https://issues.apache.org/jira/browse/MRESOLVER-63
>             Project: Maven Resolver
>          Issue Type: Improvement
>          Components: resolver
>    Affects Versions: 1.3.1
>            Reporter: Robert Scholte
>            Priority: Major
>              Labels: up-for-grabs
>             Fix For: 1.3.2
>
>
> 1.3.1 introduced the FileTransformer to allow on-the-fly transforming of data.
> For XML files it makes sense to use XMLFilters and create an XMLReader. This can throw
a SAXException, which is a checked exception, which shouldn't be rethrown as an IOException.
> Better to introduce a new Exception to handle this case properly.
> Assuming this class isn't used anywhere yet, it should be good to introduce it asap.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message