-
Notifications
You must be signed in to change notification settings - Fork 61
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
chore: Don't log 4xx
as error
#14649
Conversation
WalkthroughThe overall change involves the removal of the Changes
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Datadog ReportAll test runs ✅ 46 Total Test Services: 0 Failed, 45 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (13)
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14649 +/- ##
==========================================
- Coverage 37.04% 37.01% -0.04%
==========================================
Files 6331 6298 -33
Lines 129138 127752 -1386
Branches 36865 36534 -331
==========================================
- Hits 47838 47286 -552
+ Misses 81300 80466 -834
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 282 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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.
🚀
Merge this?
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.
Actionable comments posted: 1
Out of diff range and nitpick comments (8)
libs/clients/middlewares/README.md (8)
Line range hint
15-15
: Add a comma after "By default".- By default nothing is cached. + By default, nothing is cached.
Line range hint
47-47
: Add a comma after "Parsed JSON or string".- Parsed JSON or string depending on the response content type. + Parsed JSON or string, depending on the response content type.
Line range hint
88-88
: Add a comma after "In both modes".- In both modes you specify these options: + In both modes, you specify these options:
Line range hint
273-273
: Add a comma after "In this case".- In this case it will immediately update the cache in the background to return fresher data in future requests. + In this case, it will immediately update the cache in the background to return fresher data in future requests.
Line range hint
278-278
: Add a comma after "special consideration".- need special consideration since those won't be stored by default. + need special consideration, since those won't be stored by default.
Line range hint
296-296
: Use "e.g." instead of "eg".- (eg from [@CurrentUser](../../auth-nest-tools/README.md#using-in-rest-controller)) + (e.g. from [@CurrentUser](../../auth-nest-tools/README.md#using-in-rest-controller))
Line range hint
312-312
: Add a comma before "and".- then a warning is logged and the cache is disabled. + then a warning is logged, and the cache is disabled.
Line range hint
337-337
: Use "API-specific" instead of "API specific".- to add the API specific header keys. + to add the API-specific header keys.
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (11)
- libs/clients/administration-of-occupational-safety-and-health/src/lib/api.provider.ts (1 hunks)
- libs/clients/aircraft-registry/src/lib/apiConfig.ts (1 hunks)
- libs/clients/housing-benefit-calculator/src/lib/housing-benefit-calculator.provider.ts (1 hunks)
- libs/clients/icelandic-government-institution-vacancies/src/lib/apiConfig.ts (1 hunks)
- libs/clients/icelandic-health-insurance/health-insurance/src/lib/clients-health-insurance-v2.module.ts (1 hunks)
- libs/clients/middlewares/README.md (1 hunks)
- libs/clients/middlewares/src/lib/createEnhancedFetch.spec.ts (1 hunks)
- libs/clients/middlewares/src/lib/createEnhancedFetch.ts (4 hunks)
- libs/clients/middlewares/src/lib/withCircuitBreaker.ts (1 hunks)
- libs/clients/middlewares/src/lib/withErrorLog.ts (1 hunks)
- libs/clients/ship-registry/src/lib/ship-registry.provider.ts (1 hunks)
Files skipped from review due to trivial changes (7)
- libs/clients/administration-of-occupational-safety-and-health/src/lib/api.provider.ts
- libs/clients/aircraft-registry/src/lib/apiConfig.ts
- libs/clients/housing-benefit-calculator/src/lib/housing-benefit-calculator.provider.ts
- libs/clients/icelandic-government-institution-vacancies/src/lib/apiConfig.ts
- libs/clients/icelandic-health-insurance/health-insurance/src/lib/clients-health-insurance-v2.module.ts
- libs/clients/middlewares/src/lib/createEnhancedFetch.spec.ts
- libs/clients/ship-registry/src/lib/ship-registry.provider.ts
Additional Context Used
LanguageTool (16)
libs/clients/middlewares/README.md (16)
Near line 15: Possible missing comma found.
Context: ...pressure on the remote server. Every 30 seconds we'll allow one request through. If it'...
Near line 16: Did you mean: “By default,”?
Context: ...op of standard cache-control semantics. By default nothing is cached. - Supports our `User...
Near line 28: To form a complete sentence, be sure to include a subject.
Context: ...breaker to open. Defaults to10000
ms. Can be disabled by passing false. - `logErr...
Near line 30: It appears that a comma is missing.
Context: ...meout of 10 seconds. By passing a number you can override the idle connection timeou...
Near line 45: Possible missing article found.
Context: ...ponse: Response- The response object. Body has not been consumed. -
error.problem...
Near line 47: Possible missing comma found.
Context: ...Bodywas set to
true`. Parsed JSON or string depending on the response content type....
Near line 84: Loose punctuation mark.
Context: ...n IDP. There are three modes: -token
: Get non-user tokens using [Client Crede...
Near line 85: Loose punctuation mark.
Context: ...fc6749#section-1.3.4). -tokenExchange
: Exchange a user-token from anAuth
ob...
Near line 86: Loose punctuation mark.
Context: ...ker.ietf.org/doc/html/rfc8693). -auto
: Performs token exchange if anAuth
ob...
Near line 88: It appears that a comma is missing.
Context: ...wise fetches a non-user token. In both modes you specify these options: - `issuer: ...
Near line 154: Consider removing “of” to be more concise
Context: ...n though the current authentication has all of the specified scopes. Defaults to false. -...
Near line 273: Consider inserting a comma after an introductory phrase for better readability.
Context: ...ute old. - If it's less than 1 day old. In this case it will immediately update the cache in...
Near line 278: Possible missing comma found.
Context: ...e an authorization headers need special consideration since those won't be stored by default....
Near line 296: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...case, you need to pass aUser
object (eg from [@currentuser](../../auth-nest-too...
Near line 312: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...auth` argument, then a warning is logged and the cache is disabled. {% endhint %} I...
Near line 337: When ‘API-specific’ is used as a modifier, it is usually spelled with a hyphen.
Context: ...unction should be overridden to add the API specific header keys. ##### Example of overridi...
Path-based Instructions (4)
libs/clients/middlewares/src/lib/withCircuitBreaker.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/clients/middlewares/src/lib/withErrorLog.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/clients/middlewares/src/lib/createEnhancedFetch.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/clients/middlewares/README.md (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
Additional comments not posted (3)
libs/clients/middlewares/src/lib/withCircuitBreaker.ts (1)
20-24
: LGTM! The error filter logic correctly aligns with the objective of not treating 4xx responses as errors.libs/clients/middlewares/src/lib/withErrorLog.ts (1)
19-19
: LGTM! The log level logic correctly aligns with the objective of logging 4xx responses as warnings.libs/clients/middlewares/src/lib/createEnhancedFetch.ts (1)
Line range hint
33-33
: LGTM! The removal of thetreat400ResponsesAsErrors
option aligns with the objective of not treating 4xx responses as errors.
Why is this even a feature?
Checklist:
Summary by CodeRabbit
treat400ResponsesAsErrors
option from various API configurations. This change standardizes how 400 responses are processed across multiple modules, enhancing consistency and reliability in error management.