Skip to content

Commit

Permalink
add error code in csm (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaychen2005 authored Mar 18, 2020
1 parent a221229 commit 5ba4713
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public class PrecompiledCommon {
public static final int InvalidContractAvailable = -51901;
public static final int InvalidContractRepeatAuthorization = -51902;
public static final int InvalidContractAddress = -51903;
public static final int InvalidTableNotExist = -50104;
public static final int InvalidAuthorized = -50105;

public static final int TABLE_KEY_MAX_LENGTH = 255;

Expand Down Expand Up @@ -140,6 +142,10 @@ public static String transferToJson(int code) throws IOException {
msg = "the contract has been granted authorization with same user";
} else if (code == InvalidContractAddress) {
msg = "the contract address is invalid";
} else if (code == InvalidTableNotExist) {
msg = "the address is not exist";
} else if (code == InvalidAuthorized) {
msg = "this operation has no permissions";
}

ObjectMapper mapper = ObjectMapperFactory.getObjectMapper();
Expand Down

0 comments on commit 5ba4713

Please sign in to comment.