Commit cecf0f5
authored
add finally (#14)
* ✨ add finally callback to Try class
- Implemented `finally` method to allow users to register a callback that runs after the wrapped function finishes, regardless of success or failure.
- Updated README to include usage example for the new feature.
- Added tests to verify the execution of the `finally` callback on both successful and erroneous function executions.
Signed-off-by: w01fgang <sumin@unix-center.ru>
* 🔖 bump version to 0.0.7
Signed-off-by: w01fgang <sumin@unix-center.ru>
* Remove unused `finallyExecuted` property from Try class to streamline error handling logic.
Signed-off-by: w01fgang <sumin@unix-center.ru>
* Refactor test for Try class to use `unwrap` method and validate error handling
- Updated the test case to utilize the `unwrap` method instead of `value`.
- Adjusted the expectation to check for rejection with the correct error message.
Signed-off-by: w01fgang <sumin@unix-center.ru>
---------
Signed-off-by: w01fgang <sumin@unix-center.ru>1 parent 4a08a96 commit cecf0f5
4 files changed
Lines changed: 57 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
231 | 253 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| |||
180 | 185 | | |
181 | 186 | | |
182 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
183 | 205 | | |
184 | 206 | | |
185 | 207 | | |
| |||
352 | 374 | | |
353 | 375 | | |
354 | 376 | | |
355 | | - | |
| 377 | + | |
356 | 378 | | |
357 | 379 | | |
358 | 380 | | |
359 | | - | |
| 381 | + | |
360 | 382 | | |
361 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
362 | 389 | | |
| 390 | + | |
| 391 | + | |
363 | 392 | | |
364 | 393 | | |
365 | 394 | | |
| |||
0 commit comments