[Bps-public-commit] app-wsgetmail branch additional-diagnostic-patch created. 0.08-1-g3df05ae
BPS Git Server
git at git.bestpractical.com
Fri Nov 18 16:00:11 UTC 2022
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "app-wsgetmail".
The branch, additional-diagnostic-patch has been created
at 3df05aed95d777b9ec7b7320b2eb93fab0456dbc (commit)
- Log -----------------------------------------------------------------
commit 3df05aed95d777b9ec7b7320b2eb93fab0456dbc
Author: Brian Conry <bconry at bestpractical.com>
Date: Fri Nov 18 09:49:56 2022 -0600
Add response header logging with debug on failure
A customer working with MS support was requested to provide response
header information for troubleshooting an issue. This information was
not previously logged.
This is currently being treated as a one-off patch and not necessarily a
permanent new feature. As a new feature it may be desirable to add
debug levels or content flags.
diff --git a/lib/App/wsgetmail/MS365.pm b/lib/App/wsgetmail/MS365.pm
index d17e30a..9a46b85 100644
--- a/lib/App/wsgetmail/MS365.pm
+++ b/lib/App/wsgetmail/MS365.pm
@@ -302,6 +302,7 @@ sub get_message_mime_content {
my $response = $self->_client->get_request([@path_parts]);
unless ($response->is_success) {
warn "failed to fetch message $message_id " . $response->status_line;
+ warn "response headers from server : " . $response->headers if $self->debug;
warn "response from server : " . $response->content if $self->debug;
return undef;
}
@@ -326,6 +327,7 @@ sub delete_message {
my $response = $self->_client->delete_request([@path_parts]);
unless ($response->is_success) {
warn "failed to delete message " . $response->status_line;
+ warn "response headers from server : " . $response->headers if $self->debug;
warn "response from server : " . $response->content if $self->debug;
}
@@ -346,6 +348,7 @@ sub mark_message_as_read {
Content => encode_json({isRead => $JSON::true }) });
unless ($response->is_success) {
warn "failed to mark message as read " . $response->status_line;
+ warn "response headers from server : " . $response->headers if $self->debug;
warn "response from server : " . $response->content if $self->debug;
}
@@ -368,6 +371,7 @@ sub get_folder_details {
);
unless ($response->is_success) {
warn "failed to fetch folder detail " . $response->status_line;
+ warn "response headers from server : " . $response->headers if $self->debug;
warn "response from server : " . $response->content if $self->debug;
return undef;
}
@@ -389,6 +393,7 @@ sub _fetch_messages {
my $response = $self->_client->get_request_by_url($self->_next_fetch_url);
unless ($response->is_success) {
warn "failed to fetch messages " . $response->status_line;
+ warn "response headers from server : " . $response->headers if $self->debug;
warn "response from server : " . $response->content if $self->debug;
$self->_have_messages_to_fetch(0);
return 0;
@@ -439,6 +444,7 @@ sub _get_message_list {
unless ($response->is_success) {
warn "failed to fetch messages " . $response->status_line;
+ warn "response headers from server : " . $response->headers if $self->debug;
warn "response from server : " . $response->content if $self->debug;
return { value => [ ] };
}
-----------------------------------------------------------------------
hooks/post-receive
--
app-wsgetmail
More information about the Bps-public-commit
mailing list