Improve http response exception handling in Boilerplate (#10014)#10015
Improve http response exception handling in Boilerplate (#10014)#10015msynk merged 3 commits intobitfoundation:developfrom yasmoradi:10014
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis pull request restructures error handling and logging across both client and server components. In the client, the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant EDH as ExceptionDelegatingHandler
participant Base as BaseHandler
participant PubSub as pubSubService
Client->>EDH: SendAsync(request)
EDH->>EDH: Extract "Request-Id" header into requestIdValue
EDH->>Base: Call base.SendAsync(request)
Base-->>EDH: Return response
alt Successful response
EDH->>PubSub: Publish communication status (if internal)
EDH-->>Client: Return response
else Error encountered
EDH->>EDH: Log headers and attach requestIdValue to exception
EDH->>Client: Throw exception
end
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/ExceptionDelegatingHandler.cs(1 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/ServerExceptionHandler.cs(0 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/appsettings.Development.json(1 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/appsettings.json(1 hunks)
💤 Files with no reviewable changes (1)
- src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/ServerExceptionHandler.cs
🧰 Additional context used
🪛 Biome (1.9.4)
src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/appsettings.Development.json
[error] 70-70: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 70-70: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 70-75: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
🔇 Additional comments (4)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/HttpMessageHandlers/ExceptionDelegatingHandler.cs (2)
20-20: LGTM! Good practice to track request IDs.The addition of
requestIdValuevariable helps in correlating exceptions with their corresponding requests, improving observability.
99-103: LGTM! Good practice to enrich exceptions with request IDs.Adding the request ID to exception data helps in correlating errors with their corresponding requests in logs.
src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/appsettings.json (1)
74-74: LGTM! Appropriate log level for HTTP client.Setting the log level to "Warning" for HTTP client's logical handler is appropriate as it will capture important issues while avoiding noise from successful operations.
src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/appsettings.Development.json (1)
70-75: LGTM! Good separation of diagnostic logging concerns.The new DiagnosticLogger section provides better organization of diagnostic-specific logging settings, making it easier to manage and maintain logging configuration.
🧰 Tools
🪛 Biome (1.9.4)
[error] 70-70: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 70-70: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 70-75: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
closes #10014
Summary by CodeRabbit