aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2018-04-24 17:42:03 +0100
committerStruan Donald <struan@exo.org.uk>2018-04-26 13:53:27 +0100
commitb002374a885736b7436fc1c3132e50b6a1f8bdf9 (patch)
tree6148cdcd85ae7a538dd4e1092f21a39994492454
parent3806b6b39ace2d38c264615eb95370a303ede34c (diff)
[Open311] warn about send-comments errors if verbose flag set
Previously send-comments errors would only be printed the first time they occurred so there was no visibility of ongoing errors. This brings send-comments in line with send-reports by emitting errors if the script is called with --verbose. Fixes #2091
-rw-r--r--CHANGELOG.md1
-rwxr-xr-xbin/send-comments6
2 files changed, 6 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 66a1b69c3..2cef435f0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@
- Response templates can be triggered by external status code. #2048
- Cobrand hook for adding extra areas to MAPIT_WHITELIST/_TYPES. #2049
- Enable conversion from EPSG:27700 when fetching over Open311 #2028
+ - send-comments warns about errors when called with --verbose #2091
- Front end improvements:
- Improve questionnaire process. #1939 #1998
- Increase size of "sub map links" (hide pins, permalink, etc) #2003 #2056
diff --git a/bin/send-comments b/bin/send-comments
index 333bc2a00..ce4318f71 100755
--- a/bin/send-comments
+++ b/bin/send-comments
@@ -153,8 +153,12 @@ while ( my $body = $bodies->next ) {
$comment->update( {
send_fail_count => $comment->send_fail_count + 1,
send_fail_timestamp => \'current_timestamp',
- send_fail_reason => 'Failed to post over Open311',
+ send_fail_reason => "Failed to post over Open311\n\n" . $o->error,
} );
+
+ if ( $verbose && $o->error ) {
+ warn $o->error;
+ }
}
}
}