OSDN Git Service

Merge pull request #8 from Bytom/merge_tx_signer
[bytom/bytom-java-sdk.git] / java-sdk / src / main / java / io / bytom / exception / BuildException.java
1 package io.bytom.exception;
2
3 import com.google.gson.annotations.SerializedName;
4
5 import java.util.List;
6
7 /**
8  * BuildException wraps errors returned by the build-transaction endpoint.
9  */
10 public class BuildException extends APIException {
11
12   public BuildException(String message, String requestId) {
13     super(message, requestId);
14   }
15
16   public static class ActionError extends APIException {
17
18     public static class Data {
19       /**
20        * The index of the action that caused this error.
21        */
22       @SerializedName("index")
23       public Integer index;
24     }
25
26     public ActionError(String message, String requestId) {
27       super(message, requestId);
28     }
29
30     /**
31      * Additional data pertaining to the error.
32      */
33     public Data data;
34   }
35
36   public static class Data {
37     /**
38      * A list of errors resulting from building actions.
39      */
40     @SerializedName("actions")
41     public List<ActionError> actionErrors;
42   }
43
44   /**
45    * Extra data associated with this error, if any.
46    */
47   @SerializedName("data")
48   public Data data;
49 }