From: Matt S Trout Date: Thu, 23 Aug 2012 12:33:37 +0000 (+0100) Subject: slightly better error messages X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=22a08f9b13646963c85438fb0802f94425632b1b;p=dbsrgits%2FData-Query.git slightly better error messages --- diff --git a/lib/Data/Query/Renderer/SQL/Naive.pm b/lib/Data/Query/Renderer/SQL/Naive.pm index 7b3a941..c9d356c 100644 --- a/lib/Data/Query/Renderer/SQL/Naive.pm +++ b/lib/Data/Query/Renderer/SQL/Naive.pm @@ -79,7 +79,9 @@ sub _flatten_structure { sub _format_keyword { $_[0]->lc_keywords ? lc($_[1]) : $_[1] } sub _render { - die "Expected hashref, got $_[1]" unless ref($_[1]) eq 'HASH'; + unless (ref($_[1]) eq 'HASH') { + die "Expected hashref, got ".(defined($_[1])?$_[1]:'undef'); + } $_[0]->${\"_render_${\(lc($_[1]->{type})||'broken')}"}($_[1]); }