Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New (sub-)inspection: Masking exceptions #270

Merged

Conversation

mccartney
Copy link
Collaborator

Amending the SwallowedException inspection to check also against masked exceptions (maybe the inspection should be renamed then?), e.g.

object Test {
    try {
        println(Integer.valueOf("asdf"))
    } catch {
        case nfe: NumberFormatException =>
            throw new IllegalArgumentException("not a number")
    }
}

hides the real cause of the exception thrown. Thus caused-by section doesn't appear in the eventual stack trace

@mccartney mccartney merged commit fecc962 into scapegoat-scala:master Dec 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant