Skip to content

Commit

Permalink
improve error logging for auto sync errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Debian committed Dec 1, 2023
1 parent 58f6f40 commit 0072f9a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions disqus/rest-api/class-disqus-rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ public function rest_sync_status( WP_REST_Request $request ) {

return $this->rest_get_response( $status );
} catch ( Exception $e ) {
return $this->rest_get_error( 'There was an error fetching sync status.' );
error_log($e);
return $this->rest_get_error( 'There was an error fetching sync status. 150 character error message preview: ' . substr($e, 0, 150) );
}
}

Expand All @@ -304,7 +305,7 @@ public function rest_sync_enable( WP_REST_Request $request ) {

return $this->rest_get_response( $status );
} catch ( Exception $e ) {
return $this->rest_get_error( 'There was an error attempting to enable syncing.' );
return $this->rest_get_error( 'There was an error attempting to enable syncing. 150 character error message preview: ' . substr($e, 0, 150) );
}
}

Expand All @@ -321,7 +322,7 @@ public function rest_sync_disable( WP_REST_Request $request ) {

return $this->rest_get_response( $status );
} catch ( Exception $e ) {
return $this->rest_get_error( 'There was an error attempting to disable syncing.' );
return $this->rest_get_error( 'There was an error attempting to disable syncing. 150 character error message preview: ' . substr($e, 0, 150) );
}
}

Expand Down

0 comments on commit 0072f9a

Please sign in to comment.