Skip to content

Commit 2ec433c

Browse files
committed
AI-revise section
1 parent ffcff16 commit 2ec433c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/blog/2025-01-09-v0.3.0-release.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ For additional information on `#[cgp_getter]`, refer to the [Generic Accessor Pr
141141

142142
## `CanWrapError` Trait
143143

144-
A new `CanWrapError` trait has been introduced to simplify the wrapping of existing errors. The trait is defined as follows:
144+
The `CanWrapError` trait has been introduced to streamline the process of wrapping existing errors. Its definition is as follows:
145145

146146
```rust
147147
#[cgp_component {
@@ -152,9 +152,9 @@ pub trait CanWrapError<Detail>: HasErrorType {
152152
}
153153
```
154154

155-
Previously, the wrapping approach was to use `CanRaiseError` with a tuple, i.e. `CanRaiseError<(Self::Error, Detail)>`. However, it is quite tedious to wrap errors this way, and thus `CanWrapError` is introduced a cleaner to raise wrapped errors.
155+
Previously, error wrapping relied on using `CanRaiseError` with a tuple, such as `CanRaiseError<(Self::Error, Detail)>`. However, this approach was cumbersome and less intuitive. The `CanWrapError` trait addresses this issue by providing a cleaner and more straightforward way to raise wrapped errors.
156156

157-
More details about the use of `CanWrapError` is available at the [Error Wrapping](https://patterns.contextgeneric.dev/error-wrapping.html) chapter of the CGP Patterns book.
157+
For more details about the usage of `CanWrapError`, refer to the [Error Wrapping](https://patterns.contextgeneric.dev/error-wrapping.html) chapter in the CGP Patterns book.
158158

159159
## `cgp-error-anyhow` Crate
160160

0 commit comments

Comments
 (0)