slightly less useless error on lack of variable
Matt S Trout [Wed, 19 Feb 2014 21:07:02 +0000 (21:07 +0000)]
lib/DX/State.pm

index b75a39d..899c0d9 100644 (file)
@@ -29,7 +29,9 @@ has actions => (is => 'ro', default => sub { {} });
 
 sub scope_var {
   my ($self, $name) = @_;
-  $self->by_id->{$self->scope->{$name}};
+  my $id = $self->scope->{$name}
+    or die "no such variable in scope: $name";
+  $self->by_id->{$id};
 }
 
 sub resolve_value {