X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FStorage%2FEngine.pm;h=ec96c707c7a318aa94ad37aaf8b37fcfd00f7ec9;hb=45d9a73cb319d9cd4d3e30d07526d72cb3e11ad2;hp=50294c294196ec9bca0127a496e7a0e178f7ed80;hpb=7b428d1fd844e32dc3500a1fefc6cd794dc45fc8;p=gitmo%2FMooseX-Storage.git diff --git a/lib/MooseX/Storage/Engine.pm b/lib/MooseX/Storage/Engine.pm index 50294c2..ec96c70 100644 --- a/lib/MooseX/Storage/Engine.pm +++ b/lib/MooseX/Storage/Engine.pm @@ -2,7 +2,7 @@ package MooseX::Storage::Engine; use Moose; -our $VERSION = '0.01'; +our $VERSION = '0.02'; # the class marker when # serializing an object. @@ -68,7 +68,7 @@ sub collapse_attribute_value { # this might not be enough, we might # need to make it possible for the # cycle checker to return the value - $self->check_for_cycle_in_collapse($value) + $self->check_for_cycle_in_collapse($attr, $value) if ref $value; if (defined $value && $attr->has_type_constraint) { @@ -85,7 +85,7 @@ sub expand_attribute_value { # NOTE: # (see comment in method above ^^) - $self->check_for_cycle_in_expansion($value) + $self->check_for_cycle_in_expansion($attr, $value) if ref $value; if (defined $value && $attr->has_type_constraint) { @@ -103,16 +103,20 @@ sub expand_attribute_value { # anyway. sub check_for_cycle_in_collapse { - my ($self, $value) = @_; + my ($self, $attr, $value) = @_; (!exists $self->seen->{$value}) - || confess "Basic Engine does not support cycles"; + || confess "Basic Engine does not support cycles in class(" + . ($attr->associated_metaclass->name) . ").attr(" + . ($attr->name) . ") with $value"; $self->seen->{$value} = undef; } sub check_for_cycle_in_expansion { - my ($self, $value) = @_; + my ($self, $attr, $value) = @_; (!exists $self->seen->{$value}) - || confess "Basic Engine does not support cycles"; + || confess "Basic Engine does not support cycles in class(" + . ($attr->associated_metaclass->name) . ").attr(" + . ($attr->name) . ") with $value"; $self->seen->{$value} = undef; }