diff options
| author | Simon Rettberg | 2015-08-11 16:28:59 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2015-08-11 16:28:59 +0200 |
| commit | 04db4a28749bb2c9f1848cd3ab51fdcae569fae2 (patch) | |
| tree | f08a28b2662ac189e8301e31ab5329c2449e0628 /dozentenmodulserver/src/main/java/org | |
| parent | [client] Refined download of image a bit. (diff) | |
| download | tutor-module-04db4a28749bb2c9f1848cd3ab51fdcae569fae2.tar.gz tutor-module-04db4a28749bb2c9f1848cd3ab51fdcae569fae2.tar.xz tutor-module-04db4a28749bb2c9f1848cd3ab51fdcae569fae2.zip | |
[server] Don't swallow exceptions in User.getOrFail
Diffstat (limited to 'dozentenmodulserver/src/main/java/org')
| -rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/ServerHandler.java | 2 | ||||
| -rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/SessionManager.java | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/ServerHandler.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/ServerHandler.java index cd622197..e853fafa 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/ServerHandler.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/ServerHandler.java @@ -155,7 +155,7 @@ public class ServerHandler implements SatelliteServer.Iface { } @Override - public WhoamiInfo whoami(String userToken) throws TAuthorizationException { + public WhoamiInfo whoami(String userToken) throws TAuthorizationException, TInternalServerError { UserInfo user = SessionManager.getOrFail(userToken); return new WhoamiInfo(user, User.isSuperUser(user), User.canListImages(user)); } diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/SessionManager.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/SessionManager.java index c8384459..48876233 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/SessionManager.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/SessionManager.java @@ -71,9 +71,10 @@ public class SessionManager { * @return UserInfo for the matching user * @throws TAuthorizationException if the token is not known or the session * expired + * @throws TInternalServerError */ - public static UserInfo getOrFail(String token) throws TAuthorizationException { - UserInfo ui = get(token); + public static UserInfo getOrFail(String token) throws TAuthorizationException, TInternalServerError { + UserInfo ui = getInternal(token); if (ui != null) return ui; throw new TAuthorizationException(AuthorizationError.NOT_AUTHENTICATED, @@ -88,8 +89,7 @@ public class SessionManager { * @throws TAuthorizationException * @throws TInternalServerError */ - public static void ensureAuthenticated(String token) throws TAuthorizationException, - TInternalServerError { + public static void ensureAuthenticated(String token) throws TAuthorizationException, TInternalServerError { getInternal(token); } |
