From 78ce8aafa9a7a22bd3fc2e5ad4ba11635a82a1be Mon Sep 17 00:00:00 2001 From: Amer Sawan Date: Sun, 6 Dec 2020 17:58:23 +0300 Subject: [PATCH] Fix the sample code in the documentation --- README.rst | 6 +++--- lambda_decorators.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 2efe285..f4fa578 100644 --- a/README.rst +++ b/README.rst @@ -104,13 +104,13 @@ before/after/on_exception functionality, you can use from lambda_decorators import LambdaDecorator class log_everything(LambdaDecorator): - def before(event, context): + def before(self, event, context): logging.debug(event, context) return event, context - def after(retval): + def after(self, retval): logging.debug(retval) return retval - def on_exception(exception): + def on_exception(self, exception): logging.debug(exception) return {'statusCode': 500} diff --git a/lambda_decorators.py b/lambda_decorators.py index 961fd8e..2c8dbd0 100644 --- a/lambda_decorators.py +++ b/lambda_decorators.py @@ -105,13 +105,13 @@ def handler(event, context): from lambda_decorators import LambdaDecorator class log_everything(LambdaDecorator): - def before(event, context): + def before(self, event, context): logging.debug(event, context) return event, context - def after(retval): + def after(self, retval): logging.debug(retval) return retval - def on_exception(exception): + def on_exception(self, exception): logging.debug(exception) return {'statusCode': 500}