"""Lambda Handler.""" import sentry_sdk from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration from payoneer_payments_payout import config from payoneer_payments_payout.processor import PayoneerPaymentsPayoutProcessor if config.SENTRY_DSN: sentry_sdk.init( dsn=config.SENTRY_DSN, environment=config.ENVIRONMENT, integrations=[AwsLambdaIntegration(timeout_warning=True)] ) def handler(event, context): """Lambda entry point.""" try: processor = PayoneerPaymentsPayoutProcessor(event) processor.process() except Exception as e: print(e) raise e return {'status': 'OK', 'skipped_payoneer': processor.skipped_payoneer}