File tree 1 file changed +1
-11
lines changed
services-api/src/main/java/io/scalecube/services/methods
1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change 6
6
import io .scalecube .services .auth .Principal ;
7
7
import io .scalecube .services .auth .PrincipalMapper ;
8
8
import io .scalecube .services .exceptions .ForbiddenException ;
9
- import io .scalecube .services .exceptions .ServiceException ;
10
9
import io .scalecube .services .exceptions .ServiceProviderErrorMapper ;
11
10
import io .scalecube .services .transport .api .ServiceMessageDataDecoder ;
12
11
import java .lang .reflect .InvocationTargetException ;
@@ -264,15 +263,6 @@ private Mono<Principal> mapPrincipal(RequestContext context) {
264
263
}
265
264
266
265
return Mono .defer (() -> principalMapper .map (context ))
267
- .switchIfEmpty (Mono .just (context .principal ()))
268
- .onErrorMap (ServiceMethodInvoker ::toForbiddenException );
269
- }
270
-
271
- private static ForbiddenException toForbiddenException (Throwable ex ) {
272
- if (ex instanceof ServiceException e ) {
273
- return new ForbiddenException (e .errorCode (), e .getMessage ());
274
- } else {
275
- return new ForbiddenException (ex );
276
- }
266
+ .switchIfEmpty (Mono .just (context .principal ()));
277
267
}
278
268
}
You can’t perform that action at this time.
0 commit comments