|more useful options|
Alright, i'll give it one more try to see if i can get through to you. Here's how the situation looks like to me:
<chromatic> errors like "Error:ID:001|description|extradata:eins,zwei,drei" are terrible, because if you parse them with regexes, shit is hilariously easy to break in ways that are hell to debug or worse, you won't even NOTICEYou completely miss the crucial difference between a simple string comparison and a regex to deparse something. The former is fine because that's what perl even does when calling builtins, because they are ALSO in a hash table. The latter is a nightmare when you're dealing with inputs that are bound to change.
That was exhibit one. But there is more to come.
Um...apart from that it wasn't available until 5:30am todayMy example is a cut-down version of the synopsis, with some things changed to make it more readable for perl developers who are really adverse to thinking about things. Furthermore, the synopsis works. You can dump it into a .pl file, add a hashbang at the top and execute that and it will just plain work.
Have you even tried that or did you let your prejudices guide you?
essentially throws away the purpose of half the code including two of the dependencies of E::C.E::C's code consists of two files:
Class.pm - a factory for exceptions
Class/Base.pm - a base class with all the things exceptions can do
Its depencencies are:
Class::Data::Inheritable = 0.02
Devel::StackTrace = 1.20
Scalar::Util = 0
perl = 5.008001
So, seriously, what the hell are you talking about? Neither of this has an overlap with Try::Tiny.
There should *never* be an occasion when the failing routine has to pass you information to deal with an exception that you don't already have access to. After all, you called the routine and passed it the relevant information!You have never worked in a team where components are written by different people.
eval & die is a legitimate other way; that has been acceptable to Perl programmers for the best part of 20 years; and is used, where needed, by 18,000+ (-60 that use E::C) CPAN modules.Do you think Justin Bieber is an amazing artist and provides rich value to the human culture? (Hint: Appeal to popularity is a fallacy.)
But does no one see how easy and lightweight that can be done: die %hashYes, i did that for a while. It's nicer than strings, for reasons explained at the top, but it's also a bit clunky and makes you type a lot of stuff. I ended up having to boilerplate a lot when throwing exceptions like that, so having a module that provides a bunch of that kind of stuff in one is neat.
Now, one point i have to concede: The API for E::C is a bit atrocious, and forces you to also do a lot of boilerplating. Thus: http://www.reddit.com/r/perl/comments/domue/rfc_simple_callerbased_exception_creation/