OSDN Git Service

merge tx signer
[bytom/bytom-java-sdk.git] / tx-signer / src / main / java / io / bytom / exception / BuildException.java
diff --git a/tx-signer/src/main/java/io/bytom/exception/BuildException.java b/tx-signer/src/main/java/io/bytom/exception/BuildException.java
new file mode 100755 (executable)
index 0000000..407a8d4
--- /dev/null
@@ -0,0 +1,49 @@
+package io.bytom.exception;\r
+\r
+import com.google.gson.annotations.SerializedName;\r
+\r
+import java.util.List;\r
+\r
+/**\r
+ * BuildException wraps errors returned by the build-transaction endpoint.\r
+ */\r
+public class BuildException extends APIException {\r
+\r
+    public BuildException(String message, String requestId) {\r
+        super(message, requestId);\r
+    }\r
+\r
+    public static class ActionError extends APIException {\r
+\r
+        public static class Data {\r
+            /**\r
+             * The index of the action that caused this error.\r
+             */\r
+            @SerializedName("index")\r
+            public Integer index;\r
+        }\r
+\r
+        public ActionError(String message, String requestId) {\r
+            super(message, requestId);\r
+        }\r
+\r
+        /**\r
+         * Additional data pertaining to the error.\r
+         */\r
+        public Data data;\r
+    }\r
+\r
+    public static class Data {\r
+        /**\r
+         * A list of errors resulting from building actions.\r
+         */\r
+        @SerializedName("actions")\r
+        public List<ActionError> actionErrors;\r
+    }\r
+\r
+    /**\r
+     * Extra data associated with this error, if any.\r
+     */\r
+    @SerializedName("data")\r
+    public Data data;\r
+}\r