[Bps-public-commit] app-wsgetmail branch add-debug-output-for-unsuccessful-responses created. 231c1cd163b6f5f1878e9ad5eb1af35a83e2da4c
BPS Git Server
git at git.bestpractical.com
Wed Mar 30 17:15:18 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 231c1cd163b6f5f1878e9ad5eb1af35a83e2da4c (commit)
- Log -----------------------------------------------------------------
commit 231c1cd163b6f5f1878e9ad5eb1af35a83e2da4c
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..2611916 100644
--- a/lib/App/wsgetmail/MS365.pm
+++ b/lib/App/wsgetmail/MS365.pm
@@ -277,6 +277,11 @@ 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) {
+ require Data::Dumper;
+ print "[debug] response:\n" .
+ Data::Dumper::Dumper( $response->content );
+ }
return undef;
}
@@ -298,6 +303,11 @@ 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) {
+ require Data::Dumper;
+ print "[debug] response:\n" .
+ Data::Dumper::Dumper( $response->content );
+ }
}
return $response;
@@ -317,6 +327,11 @@ 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) {
+ require Data::Dumper;
+ print "[debug] response:\n" .
+ Data::Dumper::Dumper( $response->content );
+ }
}
return $response;
@@ -338,6 +353,11 @@ sub get_folder_details {
);
unless ($response->is_success) {
warn "failed to fetch folder detail " . $response->status_line;
+ if ($self->debug) {
+ require Data::Dumper;
+ print "[debug] response:\n" .
+ Data::Dumper::Dumper( $response->content );
+ }
return undef;
}
@@ -358,6 +378,11 @@ 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) {
+ require Data::Dumper;
+ print "[debug] response:\n" .
+ Data::Dumper::Dumper( $response->content );
+ }
$self->_have_messages_to_fetch(0);
return 0;
}
@@ -408,6 +433,11 @@ sub _get_message_list {
unless ($response->is_success) {
warn "failed to fetch messages " . $response->status_line;
+ if ($self->debug) {
+ require Data::Dumper;
+ print "[debug] response:\n" .
+ Data::Dumper::Dumper( $response->content );
+ }
return { value => [ ] };
}
-----------------------------------------------------------------------
hooks/post-receive
--
app-wsgetmail
More information about the Bps-public-commit
mailing list