swiftlang/swift

[SR-978] Warn on do {} with only one empty catch {} block

Open

#43.590 aberto em 18 de mar. de 2016

Ver no GitHub
 (10 comments) (0 reactions) (0 assignees)Swift (10.719 forks)batch import
compilerdiagnostics qualitydo catchgood first issueimprovementmissing warningstatementsswift 5.9

Métricas do repositório

Stars
 (69.989 stars)
Métricas de merge de PR
 (Mesclagem média 8d 17h) (510 fundiu PRs em 30d)

Description

Previous ID SR-978
Radar None
Original Reporter @jckarter
Type Improvement
Votes 0
Component/s Compiler
Labels Improvement, StarterBug
Assignee MultiColourPixel (JIRA)
Priority Medium

md5: d5f41243d2aaf067f1ecd57198c44970

Issue Description:

Eric Knapp caught some sample code in the wild unwisely using an empty catch block to swallow errors:

https://twitter.com/ejknapp/status/710589235464523776

We should warn on this to encourage people to use try! to trap on unexpected errors instead.

Guia do colaborador