From: Matt S Trout Date: Fri, 14 Feb 2014 19:54:21 +0000 (+0000) Subject: produce a useful error message X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FDKit.git;a=commitdiff_plain;h=6e409579e7e72f1ad7c7023ff6dc8b82b5a837af produce a useful error message --- diff --git a/lib/DX/Op/Materialize.pm b/lib/DX/Op/Materialize.pm index 7b52715..ee17e55 100644 --- a/lib/DX/Op/Materialize.pm +++ b/lib/DX/Op/Materialize.pm @@ -8,7 +8,11 @@ has var_name => (is => 'ro', required => 1); sub run { my ($self, $state) = @_; - $state->resolve_value($state->scope_var($self->var_name)); + my $var = $state->scope_var($self->var_name); + unless ($var->is_bound) { + die "Can't materialize unbound ".$self->var_name; + } + $state->resolve_value($var); $state->then($self->next); }