sanpwc commented on a change in pull request #321:
URL: https://github.com/apache/ignite-3/pull/321#discussion_r704043726



##########
File path: 
modules/raft/src/main/java/org/apache/ignite/raft/jraft/rpc/impl/RaftException.java
##########
@@ -15,38 +15,40 @@
  * limitations under the License.
  */
 
-package org.apache.ignite.raft.client.exception;
+package org.apache.ignite.raft.jraft.rpc.impl;
 
 import org.apache.ignite.lang.IgniteInternalException;
-import org.apache.ignite.raft.client.RaftErrorCode;
+import org.apache.ignite.raft.jraft.error.RaftError;
 
 /**
  * A raft exception containing code and description.
  */
 public class RaftException extends IgniteInternalException {
-    private final RaftErrorCode code;
+    /** Raft error. */
+    private final RaftError raftError;
 
     /**
-     * @param errCode Error code.
+     * @param raftError RaftError.
      */
-    public RaftException(RaftErrorCode errCode) {
-        this.code = errCode;
+    public RaftException(RaftError raftError) {
+        super(RaftError.describeCode(raftError.getNumber()));
+        this.raftError = raftError;
     }
 
     /**
-     * @param errCode Error code.
+     * @param raftError RaftError..
      * @param message Error message.
      */
-    public RaftException(RaftErrorCode errCode, String message) {
-        super(message);
+    public RaftException(RaftError raftError, String message) {
+        super(RaftError.describeCode(raftError.getNumber()) + ":" + message);

Review comment:
       Seems that describeCode is excessive here, cause it'll always return 
RaftError name.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to