Skip to content

Commit 9c61b64

Browse files
Handle permission errors in the usual way (#25)
1 parent b765248 commit 9c61b64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

router/src/main/kotlin/io/moia/router/RequestHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ abstract class RequestHandler : RequestHandler<APIGatewayProxyRequestEvent, APIG
4747
val response =
4848
try {
4949
if (missingPermissions(input, routerFunction)) {
50-
ResponseEntity(403, ApiError("missing permissions", "MISSING_PERMISSIONS"))
50+
throw ApiException("missing permissions", "MISSING_PERMISSIONS", 403)
5151
} else {
5252
val requestBody = deserializeRequest(handler, input)
5353
val request = Request(input, requestBody, routerFunction.requestPredicate.pathPattern)

0 commit comments

Comments
 (0)