Skip to content

Commit 14644f9

Browse files
committed
Get pluto error from exception
1 parent 5079f72 commit 14644f9

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ publishing {
4545

4646
publications {
4747
maven(MavenPublication) {
48-
version '0.1'
48+
version '0.1.1'
4949
group 'org.mushare'
50+
artifacts 'pluto-java-server-sdk'
5051
from components.java
5152
}
5253
}

src/main/java/org/mushare/pluto/Pluto.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static void setup(String server, String appId) {
2424
shared.appId = appId;
2525
}
2626

27-
public static PlutoUser auth(String token) {
27+
public static PlutoUser auth(String token) throws PlutoException {
2828
if (token == null) {
2929
throw new PlutoException(PlutoErrorCode.jwtFormatError);
3030
}

src/main/java/org/mushare/pluto/exception/PlutoException.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ public PlutoException(PlutoErrorCode code) {
99
this.error = new PlutoError(code);
1010
}
1111

12+
public PlutoError getError() {
13+
return error;
14+
}
15+
1216
@Override
1317
public String getMessage() {
1418
return error.getMessage();
1519
}
20+
1621
}

0 commit comments

Comments
 (0)