Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More detailed error message
  • Loading branch information
egonw committed Sep 7, 2011
1 parent b66e4cd commit 91e6a25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Expand Up @@ -82,8 +82,10 @@ public static String calculate(String service, String model,
dataset = responseString;
logger.debug("No Task, Data set: " + dataset);
}
} else if (status == 401 || status == 403) {
throw new GeneralSecurityException("No Access");
} else if (status == 401) {
throw new GeneralSecurityException("Not authenticated");
} else if (status == 403) {
throw new GeneralSecurityException("Not authorized");
} else {
throw new IllegalStateException("Service error: " + status);
}
Expand Down
Expand Up @@ -84,8 +84,10 @@ public static String calculate(String service, String descriptor,
// OK, that was quick!
dataset = responseString;
}
} else if (status == 401 || status == 403) {
throw new GeneralSecurityException("No Access");
} else if (status == 401) {
throw new GeneralSecurityException("Not authenticated");
} else if (status == 403) {
throw new GeneralSecurityException("Not authorized");
} else {
throw new IllegalStateException("Service error: " + status);
}
Expand Down

0 comments on commit 91e6a25

Please sign in to comment.