Closed kaushik-sumo closed 10 months ago
Approving to unblock, but should this have a
CHANGELOG
entry? Does this affect user-visible error responses, or is it just in our logs?Other than that, lgtm.
Yes, it is a user-facing change. Added a changelog entry here.
Sumo logic provider does not show the error code contained in the HTTP response, but only prints out generic: “failed after 11 attempts“. This was thrown by the HTTP client and was not handled. By adding an error handler in the retryable client it can be handled.
Logs printing after changes and testing in error handler:
[ERROR] Request https://long-api.sumologic.net/api/v1/monitors/root failed after 2 attempts with response: [500 Internal Server Error]
Logs printing after changes and testing in API logs:
[DEBUG] Request: [Method=GET] [URL=https://long-api.sumologic.net/api/v1/monitors/root] [Headers=map[Authorization:[xxxxxxxxxxx] Content-Type:[application/json] User-Agent:[SumoLogicTerraformProvider/dev]]]. Response: [Status=500 Internal Server Error]