design-center icon indicating copy to clipboard operation
design-center copied to clipboard

review color_die and color_warn usage, deciding when it's appropriate to print the stack

Open tzz opened this issue 13 years ago • 3 comments

As suggested by @goneri but without the Carp::Always dependency or global override.

tzz avatar Oct 13 '12 10:10 tzz

Using

perl -MCarp::Always cf-sketch.pl ...options...

is a very nice way to get stack traces during development, so at least in that context it's a very useful module.

tzz avatar Oct 13 '12 11:10 tzz

During my rewrite I replaced a lot of calls to color_warn/die to Util::error and Util::warning, with the intention of printing user-friendlier messages without stack traces and such. It should indeed be reviewed to decide when we need to print a user-readable message vs a developer-friendly message.

zzamboni avatar Oct 15 '12 22:10 zzamboni

Maybe color_die/color_warn should check if Carp::Always is loaded and defer to warn/die if so?

Then we can add --carp to the option list so you don't have to use -MCarp::Always

tzz avatar Oct 19 '12 17:10 tzz