Skip to content

Commit 16a91d7

Browse files
committed
Slight exception handling change
1 parent 7cc100c commit 16a91d7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Service/src/main/java/org/gusdb/wdk/service/filter/CheckLoginFilter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public class CheckLoginFilter implements ContainerRequestFilter, ContainerRespon
5858
@Inject
5959
protected Provider<Request> _grizzlyRequest;
6060

61-
/*************** The following methods control the default behavior for WDK endpoints ************/
61+
/*************** The following three methods control the default behavior for WDK endpoints ************/
6262

6363
// override and add paths to this list if no authentication is required AND'
6464
// no guest user should be created for this request
@@ -80,7 +80,7 @@ protected boolean isGuestUserAllowed(String path) {
8080

8181
@Override
8282
public void filter(ContainerRequestContext requestContext) throws IOException {
83-
// skip endpoints which do not require a user; prevents guests from being unnecessarily created
83+
// skip endpoints which do not require auth nor a guest user; prevents guests from being unnecessarily created
8484
String requestPath = requestContext.getUriInfo().getPath();
8585
if (isPathToSkip(requestPath)) return;
8686

@@ -131,10 +131,10 @@ public void filter(ContainerRequestContext requestContext) throws IOException {
131131
}
132132
}
133133
}
134-
catch (Exception e) {
134+
catch (WdkModelException | RuntimeException e) {
135135
// any other exception is fatal, but log first
136136
LOG.error("Unable to authenticate with Authorization header " + rawToken, e);
137-
throw e instanceof RuntimeException ? (RuntimeException)e : new WdkRuntimeException(e);
137+
throw e instanceof WdkModelException ? new WdkRuntimeException(e) : (RuntimeException)e;
138138
}
139139
}
140140

0 commit comments

Comments
 (0)