Messaging-logging (#11723)

parseBatchResponse:
we need more logs to understand why we have some empty repsonse in the
body.

For anothe PR:  
~~UNKNOWN_NETWORK_ERROR : moving from handleUnknownException to
handleTemporaryException. This is important since in the logs I saw "The
service is currently unavailable" which makes me think we should handle
this type of error with as temporary~~
This commit is contained in:
Guillim
2025-04-25 18:01:53 +02:00
committed by GitHub
parent dd446ef441
commit 95808b06b9

View File

@ -138,10 +138,21 @@ export class MicrosoftGetMessagesService {
return response.body;
}
if (!response.body) {
this.logger.error(`No body found for response`, response);
}
const errorParsed = response?.body?.error
? response.body.error
: {
message:
'Microsoft parseBatchResponse error: no response.body.error',
};
return {
error: {
...response.body.error,
statusCode: response.status,
...errorParsed,
statusCode: response?.status,
},
};
});