Skip to content

RFE: New SLF4J_LOST_EXCEPTION #74

Open
@vorburger

Description

@vorburger

Proposal for a new check which flags this up as wrong:

} catch (SomeException e) {
    LOG.error("...");
}

but this is, typically, what you want people to do instead of course:

} catch (SomeException e) {
    LOG.error("...", e);
}

I'm well aware that there are exceptions to this general rule, but in a large code base, typically this is what you do want, so in my experience enforcing this helps not having lost exceptions in production logs; and experienced senior developers would @SuppressFBWarnings for the exceptional cases when it's not wanted.

Or does a check similar to this already exist in core FindBugs or other quality control tools?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions