add himself to log
This commit is contained in:
@@ -4,7 +4,11 @@ from aws_lambda_powertools.event_handler.api_gateway import (
|
||||
APIGatewayHttpResolver,
|
||||
Response,
|
||||
)
|
||||
from aws_lambda_powertools.event_handler.exceptions import BadRequestError, ServiceError
|
||||
from aws_lambda_powertools.event_handler.exceptions import (
|
||||
BadRequestError,
|
||||
NotFoundError,
|
||||
ServiceError,
|
||||
)
|
||||
from aws_lambda_powertools.event_handler.middlewares import (
|
||||
BaseMiddlewareHandler,
|
||||
NextMiddleware,
|
||||
@@ -102,6 +106,8 @@ def _tenant(
|
||||
If tenant_id is not provided.
|
||||
ForbiddenError
|
||||
If the user lacks the necessary ACL permissions for the specified tenant_id.
|
||||
NotFoundError
|
||||
If tenant not found.
|
||||
"""
|
||||
if not tenant_id:
|
||||
raise BadRequestError('Missing tenant')
|
||||
@@ -116,5 +122,5 @@ def _tenant(
|
||||
if tenant_id == '*':
|
||||
return Tenant(id=tenant_id, name='default')
|
||||
|
||||
obj = collect.get_item(KeyPair(tenant_id, '0'))
|
||||
obj = collect.get_item(KeyPair(tenant_id, '0'), exception_cls=NotFoundError)
|
||||
return Tenant.parse_obj(obj)
|
||||
|
||||
Reference in New Issue
Block a user