papertrail / papertrail-cli

Command-line client for Papertrail hosted syslog & app log management service
http://papertrailapp.com/
MIT License
427 stars 46 forks source link

Friendly (traceless) error messages #77

Open DannyBen opened 8 years ago

DannyBen commented 8 years ago

This PR comes to improve error messages by showing only the message, and not the trace.

It rescues two exceptions:

After merging, you get these:

$ papertrail --min-time asd
Argument Error: Could not parse time string 'asd'

$ papertrail --asd
invalid option: --asd
lmarburger commented 8 years ago

Good addition. I'd be in favor of moving the exception handling behavior out into bin/papertrail in the same way interrupts are handled by adding another rescue clause for those 2 exceptions.

DannyBen commented 8 years ago

Makes sense. Will update the PR later today.

DannyBen commented 8 years ago

@lmarburger - better?

DannyBen commented 8 years ago

Note that in the other bin+lib pairs, there is also some inconsistency.

For example:

  1. in the add group lib file, there are rescue statements (which should probably go to the bin, as we did here).
  2. To achieve consistent behavior of the different CLI bins, all the bins should probably rescue the same baseline of exceptions (and this code duplication will reduce code quality metrics...).