[Bps-public-commit] app-wsgetmail branch add-debug-output-for-unsuccessful-responses created. 98147887e14aa146aeff9c21f6d12326dbc860f2

BPS Git Server git at git.bestpractical.com
Tue Apr 19 23:42:12 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, add-debug-output-for-unsuccessful-responses has been created
        at  98147887e14aa146aeff9c21f6d12326dbc860f2 (commit)

- Log -----------------------------------------------------------------
commit 98147887e14aa146aeff9c21f6d12326dbc860f2
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Wed Mar 30 12:14:07 2022 -0500

    Add debug output for unsuccessful responses

diff --git a/lib/App/wsgetmail/MS365.pm b/lib/App/wsgetmail/MS365.pm
index 4015827..f40c69b 100644
--- a/lib/App/wsgetmail/MS365.pm
+++ b/lib/App/wsgetmail/MS365.pm
@@ -279,6 +279,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 from server : " . $response->content if $self->debug;
         return undef;
     }
 
@@ -300,6 +301,7 @@ sub delete_message {
     my $response = $self->_client->delete_request([@path_parts]);
     unless ($response->is_success) {
         warn "failed to mark message as read " . $response->status_line;
+        warn "response from server : " . $response->content if $self->debug;
     }
 
     return $response;
@@ -319,6 +321,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 from server : " . $response->content if $self->debug;
     }
 
     return $response;
@@ -340,6 +343,7 @@ sub get_folder_details {
     );
     unless ($response->is_success) {
         warn "failed to fetch folder detail " . $response->status_line;
+        warn "response from server : " . $response->content if $self->debug;
         return undef;
     }
 
@@ -360,6 +364,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 from server : " . $response->content if $self->debug;
             $self->_have_messages_to_fetch(0);
             return 0;
         }
@@ -410,6 +415,7 @@ sub _get_message_list {
 
     unless ($response->is_success) {
         warn "failed to fetch messages " . $response->status_line;
+        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