diff --git a/app/server/lib/Exception.pm b/app/server/lib/Exception.pm index dfaf3dc..feb8682 100644 --- a/app/server/lib/Exception.pm +++ b/app/server/lib/Exception.pm @@ -48,6 +48,10 @@ sub new { my $class = shift; my %args = @_; + # Remove leading and/or trailing whitespace + $args{'msg'} =~ s/(^\s+|\s+$)//g; + $args{'dbg'} =~ s/(^\s+|\s+$)//g; + my $self = bless { 'code' => $args{'code'}, 'msg' => $args{'msg'}, @@ -55,10 +59,6 @@ sub new { 'time' => Time::HiRes::time }, ( ref($class) || $class ); - # Remove leading and/or trailing whitespace - $args{'msg'} =~ s/(^\s+|\s+$)//g; - $args{'dbg'} =~ s/(^\s+|\s+$)//g; - return $self; }