-
Notifications
You must be signed in to change notification settings - Fork 140
Exporter: add more logs for API error responses #2602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: stage
Are you sure you want to change the base?
Conversation
Greptile OverviewGreptile SummaryThis PR centralizes error handling for exporter API endpoints by introducing a new Key Changes:
Benefits:
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Client
participant Handler as API Handler
participant toApiError
participant Logger
participant Response as ErrorResponse
Client->>Handler: HTTP Request (with invalid params)
Handler->>Handler: api.Bind() / validate()
alt Validation Error
Handler->>toApiError: (logger, r, endpoint, 400, request, err)
toApiError->>Response: Create ErrorResponse (BadRequestError)
toApiError->>Logger: Error("exporter API request failed", fields...)
toApiError-->>Handler: ErrorResponse
Handler-->>Client: HTTP 400 + JSON error
end
alt Internal Server Error
Handler->>Handler: Process request (store.Get...)
Handler->>toApiError: (logger, r, endpoint, 500, request, err)
toApiError->>Response: Create ErrorResponse (custom 500)
toApiError->>Logger: Error("exporter API request failed", fields...)
toApiError-->>Handler: ErrorResponse
Handler-->>Client: HTTP 500 + JSON error
end
Note over toApiError,Logger: All error logging now centralized<br/>with consistent fields: endpoint,<br/>method, path, status, error, request
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, no comments
Codecov Report❌ Patch coverage is ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
iurii-ssv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
No description provided.