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

BPS Git Server git at git.bestpractical.com
Wed Mar 30 18:02:38 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  ba236788b3e23939bcd7499cb8102f617c4fad82 (commit)

- Log -----------------------------------------------------------------
commit ba236788b3e23939bcd7499cb8102f617c4fad82
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..fb39b7c 100644
--- a/lib/App/wsgetmail/MS365.pm
+++ b/lib/App/wsgetmail/MS365.pm
@@ -277,6 +277,9 @@ 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;
+        if ($self->debug) {
+            warn "response: " . $response->content . "\n";
+        }
         return undef;
     }
 
@@ -298,6 +301,9 @@ 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;
+        if ($self->debug) {
+            warn "response: " . $response->content . "\n";
+        }
     }
 
     return $response;
@@ -317,6 +323,9 @@ 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;
+        if ($self->debug) {
+            warn "response: " . $response->content . "\n";
+        }
     }
 
     return $response;
@@ -338,6 +347,9 @@ sub get_folder_details {
     );
     unless ($response->is_success) {
         warn "failed to fetch folder detail " . $response->status_line;
+        if ($self->debug) {
+            warn "response: " . $response->content . "\n";
+        }
         return undef;
     }
 
@@ -358,6 +370,9 @@ 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;
+            if ($self->debug) {
+                warn "response: " . $response->content . "\n";
+            }
             $self->_have_messages_to_fetch(0);
             return 0;
         }
@@ -408,6 +423,9 @@ sub _get_message_list {
 
     unless ($response->is_success) {
         warn "failed to fetch messages " . $response->status_line;
+        if ($self->debug) {
+            warn "response: " . $response->content . "\n";
+        }
         return { value => [ ] };
     }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
app-wsgetmail


More information about the Bps-public-commit mailing list