Improve graph API response and error handling

Created on 7 November 2024, 14 days ago

Problem/Motivation

The current mail sending logic in Transport\Api\MicrosoftGraphApiTransport::doSendApi mentions that the response is empty. This is because the response needs to be read from the response handler.

Proposed resolution

Construct a response handler object, pass it to the request builder and read the response from there after sending it.

The merge request also refactors the error handling logic to work with the new information. A HTTP 202 response indicates a success, no response is now returned as an HTTP 500 error. Any other responses are returned as before with the code, headers and body of the graph API response itself. A more specific TransportException is thrown if the email cannot be converted to a graph email message.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇳🇱Netherlands dennis_meuwissen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024