Commit graph

137 commits

Author SHA1 Message Date
82a4164780
tests: add tests for annotated error display, debug, and chaining (#19)
Introduced tests to verify the behavior of `AnnotatedError` in display,
debug, and error chaining scenarios. Ensured proper formatting for
standalone errors and preservation of the error chain for wrapped
errors.
2025-03-31 14:16:35 +02:00
75b7fdf363 tests: add tests for annotated error display, debug, and chaining
Introduced tests to verify the behavior of `AnnotatedError` in display, debug, and error chaining scenarios. Ensured proper formatting for standalone errors and preservation of the error chain for wrapped errors.
2025-03-31 14:14:43 +02:00
d164662537
doc: add usage example for error handling in main function (#18)
This commit adds a usage example demonstrating how to handle errors
returned by the `func1` function in the main function. The example
provides clarity on practical error handling and makes the documentation
more comprehensive for users.
2025-03-31 14:05:37 +02:00
5390007cbe doc: add usage example for error handling in main function
This commit adds a usage example demonstrating how to handle errors returned by the `func1` function in the main function. The example provides clarity on practical error handling and makes the documentation more comprehensive for users.
2025-03-31 14:04:15 +02:00
354f7b92ed
tests: add comprehensive unit tests for error handling utilities (#17)
This commit introduces a series of unit tests to validate various error
handling functionalities, including error chaining, root cause
extraction, display/debug formatting, annotation, context mapping,
downcasting, and custom error kinds. These tests improve code
reliability and ensure expected behavior across different error
scenarios.
2025-03-31 13:57:25 +02:00
9aa0183d65 tests: add comprehensive unit tests for error handling utilities
This commit introduces a series of unit tests to validate various error handling functionalities, including error chaining, root cause extraction, display/debug formatting, annotation, context mapping, downcasting, and custom error kinds. These tests improve code reliability and ensure expected behavior across different error scenarios.
2025-03-31 13:54:52 +02:00
46bf63fd32
chore: update Rust installation in coverage workflow (#16)
Replaced manual Rust installation with dtolnay/rust-toolchain action for
better maintainability and clarity. Added necessary components like
llvm-tools-preview to support code coverage generation. These changes
simplify the workflow setup.
2025-03-31 13:23:23 +02:00
5cb96eeee3 chore: update Rust installation in coverage workflow
Replaced manual Rust installation with dtolnay/rust-toolchain action for better maintainability and clarity. Added necessary components like llvm-tools-preview to support code coverage generation. These changes simplify the workflow setup.
2025-03-31 13:21:45 +02:00
0cee763264
chore: update coverage workflow to simplify and modernize setup (#15)
Revised the GitHub Actions workflow for code coverage by updating
dependencies, using modern, maintained actions, and improving
configuration clarity. Streamlined Rust installation and replaced manual
steps with dedicated actions for better reliability. Adjusted Codecov
settings for stricter error handling.
2025-03-31 13:15:11 +02:00
74f1dd4314 chore: update coverage workflow to simplify and modernize setup
Revised the GitHub Actions workflow for code coverage by updating dependencies, using modern, maintained actions, and improving configuration clarity. Streamlined Rust installation and replaced manual steps with dedicated actions for better reliability. Adjusted Codecov settings for stricter error handling.

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2025-03-31 13:14:20 +02:00
24382fbaed
chore: Release chainerror version 1.0.0 2023-07-28 17:11:10 +02:00
ae10e2e14f
doc: README.md changed text to console (#14) 2023-07-28 17:10:33 +02:00
c630f84690
doc: README.md changed text to console
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-28 17:09:18 +02:00
25ebe8333f
0.9 (#13)
prepare for 1.0
2023-07-28 17:08:42 +02:00
9e03541ac1
doc: extend README.md with display formats
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-28 17:06:57 +02:00
46b7f58e72
feat: add annotate() method to Context
to just annotate the passed error with location data

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-28 17:06:10 +02:00
101d2074e1
feat: removed prelude
It was causing the rust compiler to output the renamed structs in error
messages confusing users who don't know about the old renamed ones.

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-28 17:04:39 +02:00
aaca6945b0
feat: add new(Into<String>) method for str_context! types
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-28 16:32:46 +02:00
cb9465f0df
chore: remove obsolete README.tpl
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-28 16:22:15 +02:00
82257c881a
docs: use new names
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-28 16:22:00 +02:00
55c16d7867
tests: use new names
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-28 16:20:55 +02:00
3ab04cca25
feat: cleanup names
- ResultTrait -> Context
- ChainErrorDown -> ErrorDown
- derive_err_kind -> err_kind
- derive_str_context -> str_context
- add `prelude::v2` with only the traits

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-28 16:18:54 +02:00
cb2e1509e5
chore: remove more Chain.. occurences
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-28 15:28:27 +02:00
cacfb37d44
chore: Release chainerror version 0.8.2 2023-07-28 15:18:14 +02:00
5ddc595e3f
ci: use ubuntu-latest (#12)
The ubuntu-18.04 environment is deprecated.
2023-07-28 15:15:21 +02:00
11aeeb17c3
ci: use ubuntu-latest
The ubuntu-18.04 environment is deprecated.

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-28 15:13:50 +02:00
7267a08b68
fix: re-add the basic doc test (#11)
and more doc improvements
2023-07-28 15:09:35 +02:00
a116310c4d
doc: improvements
- remove `Chain…` mentions in the docs
- add doc links
- add rustdoc feature to scrape the examples for code

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-28 15:06:31 +02:00
968c83983a
fix: re-add the basic doc test
It got lost with the `README.md` conversion.

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-28 15:04:29 +02:00
9e7492f67f
chore: Release chainerror version 0.8.1-alpha.1 2023-07-27 15:29:06 +02:00
87bac108d2
chore: Release chainerror version 0.8.0 2023-07-27 15:28:18 +02:00
005d46bf4d
0.8 changes (#10)
* use `#[track_caller]`
* removed feature `display-cause`
* remove ChainErrorFrom and IntoChainError, add From
* cleanup
2023-07-27 15:00:07 +02:00
cf62d1a9f9
chore: remove need for cargo readme
Just use `#![doc = include_str!("../README.md")]`

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-27 14:59:05 +02:00
165c1b939c
chore: suppress clippy errors in tutorial
code is in this state by purpose

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-27 14:37:19 +02:00
1327575aa9
feat!: remove Chain prefix from Error and Result
like `anyhow`

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-27 14:36:52 +02:00
Harald Hoyer
f5c8afce0d
feat: remove ChainErrorFrom and IntoChainError, add From
ChainErrorFrom and IntoChainError are not needed anymore with the
`#[track_caller]` feature.

Now, a proper `From<T> for ChainError<T>` can be implemented.
2023-07-27 14:32:30 +02:00
Harald Hoyer
bdfec08228
feat: add inline to context and map_context methods 2023-07-27 14:32:26 +02:00
Harald Hoyer
4eae3da3c1
feat: removed feature display-cause
`display-cause` can be turned on with the `{:#}` format specifier
2023-07-27 14:32:21 +02:00
b2a62b2f55
chore: Release chainerror version 0.7.2-alpha.1 2023-07-27 14:29:29 +02:00
e90072f079
chore: Release chainerror version 0.7.1 2023-07-27 14:24:20 +02:00
1a102e1b5c
Merge pull request #9 from haraldh/license
chore: fix License to SPDX syntax
2023-07-27 14:15:37 +02:00
a34929600e
chore: fix License to SPDX syntax
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-27 14:13:34 +02:00
06da605462
Merge pull request #8 from haraldh/CI
CI update + Doc test fix
2023-07-27 14:07:21 +02:00
95c5a02d50
test: rewrite doc test
Line numbering has changed in Rust 1.71 in the doc tests, due to an
extra inserted `#[allow(unused_extern_crates)]` line.

Don't test for the exact line number anymore.

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-27 14:04:02 +02:00
376e133836
ci: use codecov for coverage
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-27 14:03:18 +02:00
bb5f372a92
fix: use dtolnay/rust-toolchain
instead of `actions-rs/toolchain`

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-27 14:03:15 +02:00
d60cdf9cdb
fix: clippy
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2023-07-27 14:03:12 +02:00
Harald Hoyer
05085229be
chore: fix github pages deploy
set-env is deprecated ... remove the caching stuff
2021-02-02 09:45:23 +01:00
Harald Hoyer
d577243d8e
(cargo-release) start next development iteration 0.7.1-alpha.0 2021-02-02 09:12:07 +01:00
Harald Hoyer
ee385c1fe0
(cargo-release) version 0.7.0 2021-02-02 09:11:42 +01:00