-
Notifications
You must be signed in to change notification settings - Fork 87
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
feat: [#495] Centralize Error Messages in Framework (PR#1) #663
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #663 +/- ##
==========================================
- Coverage 70.57% 70.52% -0.05%
==========================================
Files 186 187 +1
Lines 11877 11902 +25
==========================================
+ Hits 8382 8394 +12
- Misses 2924 2935 +11
- Partials 571 573 +2 ☔ View full report in Codecov by Sentry. |
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to use it? Add an example?
Added an example |
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.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50
.
Benchmark suite | Current: 11dd986 | Previous: aeaf75d | Ratio |
---|---|---|---|
Benchmark_Panic |
0.001077 ns/op 0 B/op 0 allocs/op |
0.0006658 ns/op 0 B/op 0 allocs/op |
1.62 |
Benchmark_Panic - ns/op |
0.001077 ns/op |
0.0006658 ns/op |
1.62 |
This comment was automatically generated by workflow using github-action-benchmark.
contracts/errors/errors.go
Outdated
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.
It seems unnecessary.
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.
It's good to have, don't want to return errorString
.
errors/errors.go
Outdated
return formattedText | ||
} | ||
|
||
func (e *errorString) Location(location string) contractserrors.Error { |
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.
Location
vs Module
?
func Is(err, target error) bool { | ||
return errors.Is(err, target) | ||
} | ||
|
||
func As(err error, target any) bool { | ||
return errors.As(err, &target) | ||
} | ||
|
||
func Unwrap(err error) error { | ||
return errors.Unwrap(err) | ||
} |
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.
We can add them when needed.
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.
Is
is being used at some places
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.
Great 👍
📑 Description
Example
RelatedTo goravel/goravel#495
Summary by CodeRabbit
These changes improve the clarity and context of error reporting within the application.
✅ Checks