Skip to content

Allow swallowed exceptions to be logged #78

Description

@lindyhopchris

Hi! Happy to create a PR for this, but wanted to check the idea with you before spending the time doing that.

At the moment you can set no_except to true to swallow exceptions. Which in our application is the desired behaviour - we don't want the customer to get a 500 error just because something went wrong with the IP lookup.

However, swallowing without logging the exception (current behaviour) is risky, because the implementation could be completely not working (e.g. maybe you forgot to set your token, or your token is no longer valid, etc) and you'd never know about it.

My idea is that a no_except_log_level could be added as a config option. If set to a PSR log level, it would log the exception at that level if swallowing it. The reason for giving flexibility on the log level is different applications might want to treat this with a different level of severity.

The default could either be null (i.e. don't log) or debug. Or something else?

Let me know what you think and I'll create a PR if it's a go!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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