in reply to Moose warnings
So this particular case is likely fixable, so please do submit a bug report on it.
Let me also say that we (the moose devs) know the error handling in Moose is not ideal and could be improved. However, Moose is unlike your typical CPAN module because of how deep it goes into your code. So while we know it is not ideal, fixing this is pretty non-trivial and so we opt to give the user the most information possible (the stack trace) rather then leaving you with not enough information.
The real issue is that it is often very difficult for Moose to divine the intention of the user from the error condition that is thrown. And further still, the context in which the error occurs can be nowhere near the actual source of the error, and going from context to intent is often times just impossible. Doing this kind of error handling inside a library is very difficult, often times you can only get this kind of contextually sensitive error handling in a parser/lexer/compiler (and even then, not always, just ask anyone who has done any serious Haskell programming).
So, regarding your code. There is a Moose::Error subsystem which will allow to replace the default confess stack trace with the less verbose croak or even write your own error handler (see Moose::Error::Croak for some details). For a more generic solution to the issue you might want to take a look at that.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Moose warnings
by bobr (Monk) on May 07, 2010 at 09:21 UTC |