On Thu, Oct 29, 2009 at 10:29:37PM -0500, Evan Carroll wrote: > > I was getting a constraint violation that appeared to come out of nowhere. > > It wasn't anywhere that was attempting to set the attribute or call a > > constructor. > > I couldn't tell where the error was coming from because the Moose error > >system doesn't include the complete stack. > > That kind of sounds crazy. > > > By making throw_error() confess() I was able to get the complete stack and > >tell that what was going wrong was that the attribute's value builder was > >returning undef. > > throw_error currently confesses, check Moose.pm > > use Carp 'confess'; > .. > sub throw_error { > # FIXME This > shift; > goto \&confess > }
Nope. Moose::throw_error is completely unrelated to Moose::Meta::Class::throw_error, which is what's being discussed here. > Furthermore, all sane people rely on Devel::SimpleTrace which makes > any warning or die dump the stack. I believe some of the mop and moose > set the stack level for Carp internally, and there might a problem > with that. I still interested in your problem: your example doesn't > demonstrate anything. This is true though - could you give an example of the stack trace you're getting, and what you got when you replaced it with a direct call to confess? -doy