aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/Open311.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/perllib/Open311.pm b/perllib/Open311.pm
index 56fe567c5..c0e27f96b 100644
--- a/perllib/Open311.pm
+++ b/perllib/Open311.pm
@@ -539,8 +539,11 @@ sub _process_error {
my $msg = '';
if ( ref $obj && exists $obj->{error} ) {
- my $errors = $obj->{error};
- $msg .= sprintf( "%s: %s\n", $_->{code}, $_->{description} ) for @{ $errors };
+ for (@{ $obj->{error} }) {
+ my $code = $_->{code} || '???';
+ my $desc = $_->{description} || 'unknown error';
+ $msg .= sprintf("%s: %s\n", $code, $desc);
+ }
}
return $msg || 'unknown error';