rspec/rules/S2096/description.adoc

5 lines
396 B
Plaintext
Raw Normal View History

2021-01-27 13:42:22 +01:00
There's no reason for a ``++main++`` method to ``++throw++`` anything. After all, what's going to catch it?
2020-06-30 12:48:07 +02:00
2021-02-02 15:02:10 +01:00
2021-01-27 13:42:22 +01:00
Instead, the method should itself gracefully handle any exceptions that may bubble up to it, attach as much contextual information as possible, and perform whatever logging or user communication is necessary, and ``++exit++`` with a non-zero (i.e. non-success) exit code if necessary.