[freeside-devel] Error handling from _custoragent_session_custnum
Randall Lucas
rlucas at tercent.net
Thu Jul 7 09:47:11 PDT 2005
I have been getting some "Unknown custnum " errors in integrating my new
code with our existing FS install. In tracking this down, I've been
reading ClientAPI/MyAccount.pm and am puzzled by this error checking idiom:
my($context, $session, $custnum) = _custoragent_session_custnum($p);
return { 'error' => $session } if $context eq 'error';
(found in e.g. order_pkg, unprovision_svc and elsewhere.)
Upon error, _custoragent_session_custnum returns a hashref, while it
normally returns a three-element array. I believe this is just curly
braces where parens are needed.
I'm attaching a patch.
-------------- next part --------------
Index: MyAccount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MyAccount.pm,v
retrieving revision 1.36
diff -r1.36 MyAccount.pm
781c781
< or return { 'error' => "Can't resume session" }; #better error message
---
> or return ( 'error' => "Can't resume session" ); #better error message
791c791
< or return { 'error' => "Can't resume session" }; #better error message
---
> or return ( 'error' => "Can't resume session" ); #better error message
795c795
< return { 'error' => "Can't resume session" }; #better error message
---
> return ( 'error' => "Can't resume session" ); #better error message
More information about the freeside-devel
mailing list