这是indexloc提供的服务,不要输入任何密码
Skip to content

Error when using honeybadger with AWS Lambda with python 3.10 #141

@samuelcea

Description

@samuelcea

Hello,

I'm having a problem when trying to get Honeybadger workiing with an AWS Lambda with python 3.10 (recently released), i'm following the code exposed on the docs to configure honeybadger on lambdas and it doesn't show more than just configuring it, but when an error is raised it doesn't get it and the logs shows this Lambda function not wrapped by honeybadger: module '__main__' has no attribute 'handle_event_request', if i call .notify inside the code it works, but when an unexpected exception is raised, it's not triggered to HB.

This is my code

honeybadger.configure(api_key=Settings.HONEYBADGER_API_KEY, environment=Settings.ENVIRONMENT)


def handler(event: dict, context: LambdaContext) -> None:  # dead: disable
    try:
        logger.info(f"event: {event} context {context}")
        for record in chain.from_iterable(event["records"].values()):
            # example code
    except Exception as e:
        honeybadger.notify(e)
        raise e

I need to clarify that the api_key is correctly and the environment too, if not, i shouldn't be getting the error on my HB dashboard.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions