Skip to content

Commit

Permalink
feat: show better error message (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
liewstar authored Jan 23, 2025
1 parent 623968c commit c3612e9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/org/casbin/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ public static String run(String... args) {
return o.toString();

} catch (Exception e) {
e.printStackTrace();
System.out.println("Run './casbin --help or ./casbin -h' for usage.");
Throwable cause = e.getCause();
if (cause instanceof org.casbin.jcasbin.exception.CasbinMatcherException) {
System.out.println(cause.getMessage());
} else {
e.printStackTrace();
System.out.println("Run './casbin --help or ./casbin -h' for usage.");
}
System.exit(1);
}
return result;
Expand Down

0 comments on commit c3612e9

Please sign in to comment.