bharatviswa504 commented on a change in pull request #2267:
URL: https://github.com/apache/ozone/pull/2267#discussion_r636687565
##########
File path:
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineNotFoundException.java
##########
@@ -18,18 +18,18 @@
package org.apache.hadoop.hdds.scm.pipeline;
-import java.io.IOException;
+import org.apache.hadoop.hdds.scm.exceptions.SCMException;
/**
* Signals that a pipeline is missing from PipelineManager.
*/
-public class PipelineNotFoundException extends IOException{
+public class PipelineNotFoundException extends SCMException {
/**
* Constructs an {@code PipelineNotFoundException} with {@code null}
* as its error detail message.
*/
public PipelineNotFoundException() {
- super();
+ super(ResultCodes.PIPELINE_NOT_FOUND);
Review comment:
RemoteException unwrapException code and instantiateException, only
message will be saved.
```public IOException unwrapRemoteException() {
try {
Class<?> realClass = Class.forName(getClassName());
return instantiateException(realClass.asSubclass(IOException.class));
} catch(Exception e) {
// cannot instantiate the original exception, just return this
}
return this;
}
private IOException instantiateException(Class<? extends IOException> cls)
throws Exception {
Constructor<? extends IOException> cn = cls.getConstructor(String.class);
cn.setAccessible(true);
IOException ex = cn.newInstance(this.getMessage());
ex.initCause(this);
return ex;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]