From 69ea5b10ee09a1929a831773d6a97f685653e90c Mon Sep 17 00:00:00 2001 From: Scott Walters Date: Thu, 26 Sep 2013 18:01:41 -0500 Subject: [PATCH] a few improvements to error reporting/handling --- lib/WebGUI/Content/Admin.pm | 2 +- lib/WebGUI/Pluggable.pm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Content/Admin.pm b/lib/WebGUI/Content/Admin.pm index 29ea7b1d7..b5af10780 100644 --- a/lib/WebGUI/Content/Admin.pm +++ b/lib/WebGUI/Content/Admin.pm @@ -85,7 +85,7 @@ sub handler { if ( $session->form->get("op") eq "assetHelper" ) { # Load and run the requested asset helper www_ method - my $assetId = $session->form->get('assetId'); + my $assetId = $session->form->get('assetId') or $session->log->fatal("no assetId passed to op=assetHelper"); my $asset = WebGUI::Asset->newById( $session, $assetId ); my $helperId = $session->form->get('helperId'); diff --git a/lib/WebGUI/Pluggable.pm b/lib/WebGUI/Pluggable.pm index b28132124..fb8848996 100644 --- a/lib/WebGUI/Pluggable.pm +++ b/lib/WebGUI/Pluggable.pm @@ -17,6 +17,7 @@ package WebGUI::Pluggable; use strict; use Module::Find; use Carp qw(croak); +use Scalar::Util 'blessed'; # Carps should always bypass this package in error reporting $Carp::Internal{ __PACKAGE__ }++; @@ -258,7 +259,7 @@ sub load { else { $moduleError{$module} = "Could not load $module because $@"; } - croak $moduleError{$module}; + die $@; # rethrow the error so that we preserve the full stack trace of where the error came from } }