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

BPS Git Server git at git.bestpractical.com
Wed Mar 30 19:18:17 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  2422d848e6567635ed2bd5dc2b33b14926978cb5 (commit)

- Log -----------------------------------------------------------------
commit 2422d848e6567635ed2bd5dc2b33b14926978cb5
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 286b9c3..75cfb41 100644
--- a/lib/App/wsgetmail/MS365.pm
+++ b/lib/App/wsgetmail/MS365.pm
@@ -277,6 +277,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;
     }
 
@@ -298,6 +299,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;
@@ -317,6 +319,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;
@@ -338,6 +341,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;
     }
 
@@ -358,6 +362,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;
         }
@@ -408,6 +413,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