Skip to content

Commit d220b5e

Browse files
authored
Merge pull request #90 from RAprogramm/codex/fix-missing-readme.md-for-publish
Fix masterror-derive publish by adding README
2 parents 13329b7 + 65f8981 commit d220b5e

File tree

6 files changed

+93
-12
lines changed

6 files changed

+93
-12
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file.
33

44
## [Unreleased]
55

6+
## [0.10.6] - 2025-09-21
7+
8+
### Fixed
9+
- Added a crate-local README for `masterror-derive` so `cargo publish` passes
10+
when crates.io validates the `readme` manifest key.
11+
12+
### Changed
13+
- Bumped `masterror-derive` to `0.6.2` to capture the packaging fix.
14+
15+
### Documentation
16+
- Documented the derive macros and supported attributes in
17+
`masterror-derive/README.md` for crates.io readers.
18+
619
## [0.10.5] - 2025-09-20
720

821
### Added

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "masterror"
3-
version = "0.10.5"
3+
version = "0.10.6"
44
rust-version = "1.90"
55
edition = "2024"
66
license = "MIT OR Apache-2.0"
@@ -71,7 +71,7 @@ turnkey = []
7171
openapi = ["dep:utoipa"]
7272

7373
[workspace.dependencies]
74-
masterror-derive = { version = "0.6.1" }
74+
masterror-derive = { version = "0.6.2" }
7575
masterror-template = { version = "0.3.1" }
7676

7777
[dependencies]

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Stable categories, conservative HTTP mapping, no `unsafe`.
2929

3030
~~~toml
3131
[dependencies]
32-
masterror = { version = "0.10.5", default-features = false }
32+
masterror = { version = "0.10.6", default-features = false }
3333
# or with features:
34-
# masterror = { version = "0.10.5", features = [
34+
# masterror = { version = "0.10.6", features = [
3535
# "axum", "actix", "openapi", "serde_json",
3636
# "sqlx", "sqlx-migrate", "reqwest", "redis",
3737
# "validator", "config", "tokio", "multipart",
@@ -66,10 +66,10 @@ masterror = { version = "0.10.5", default-features = false }
6666
~~~toml
6767
[dependencies]
6868
# lean core
69-
masterror = { version = "0.10.5", default-features = false }
69+
masterror = { version = "0.10.6", default-features = false }
7070

7171
# with Axum/Actix + JSON + integrations
72-
# masterror = { version = "0.10.5", features = [
72+
# masterror = { version = "0.10.6", features = [
7373
# "axum", "actix", "openapi", "serde_json",
7474
# "sqlx", "sqlx-migrate", "reqwest", "redis",
7575
# "validator", "config", "tokio", "multipart",
@@ -623,13 +623,13 @@ assert_eq!(resp.status, 401);
623623
Minimal core:
624624

625625
~~~toml
626-
masterror = { version = "0.10.5", default-features = false }
626+
masterror = { version = "0.10.6", default-features = false }
627627
~~~
628628

629629
API (Axum + JSON + deps):
630630

631631
~~~toml
632-
masterror = { version = "0.10.5", features = [
632+
masterror = { version = "0.10.6", features = [
633633
"axum", "serde_json", "openapi",
634634
"sqlx", "reqwest", "redis", "validator", "config", "tokio"
635635
] }
@@ -638,7 +638,7 @@ masterror = { version = "0.10.5", features = [
638638
API (Actix + JSON + deps):
639639

640640
~~~toml
641-
masterror = { version = "0.10.5", features = [
641+
masterror = { version = "0.10.6", features = [
642642
"actix", "serde_json", "openapi",
643643
"sqlx", "reqwest", "redis", "validator", "config", "tokio"
644644
] }

masterror-derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "masterror-derive"
33
rust-version = "1.90"
4-
version = "0.6.1"
4+
version = "0.6.2"
55
edition = "2024"
66
license = "MIT OR Apache-2.0"
77
repository = "https://github.com/RAprogramm/masterror"

masterror-derive/README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# masterror-derive
2+
3+
Procedural macros that power [`masterror`](https://crates.io/crates/masterror)'s
4+
`#[derive(Error)]`. The derive generates ergonomic `std::error::Error` and
5+
`Display` implementations together with seamless integration into
6+
`masterror`'s domain-centric `AppError` type.
7+
8+
> **Tip:** Depend on the `masterror` crate in application code and import the
9+
> macros from there (`use masterror::Error;`). This standalone crate is
10+
> published to make `cargo install`/`cargo package` flows happy and to support
11+
> advanced macro integrations.
12+
13+
## Quick start
14+
15+
```toml
16+
[dependencies]
17+
masterror = "0.10"
18+
```
19+
20+
```rust
21+
use masterror::{AppError, Error};
22+
23+
#[derive(Error)]
24+
#[error(display = "failed to parse payload: {source}")]
25+
#[app_error(kind = "BadRequest")]
26+
pub struct PayloadInvalid {
27+
#[source]
28+
pub source: serde_json::Error,
29+
}
30+
31+
fn parse(input: &str) -> Result<(), AppError> {
32+
serde_json::from_str::<serde_json::Value>(input)
33+
.map(|_| ())
34+
.map_err(PayloadInvalid::from)
35+
}
36+
```
37+
38+
The derive implements `Display`, `std::error::Error`, and conversion glue so
39+
you can return rich `AppError` values with a single `?`.
40+
41+
## Supported attributes
42+
43+
- `#[error(display = ...)]` – formats the error message using captured fields.
44+
- `#[source]` / `#[from]` – wires source error propagation and conversion.
45+
- `#[backtrace]` – exposes an optional captured `Backtrace`.
46+
- `#[app_error(...)]` – configures how the error maps into `AppError`
47+
(kind, HTTP status, telemetry).
48+
- `#[provide(...)]` – attaches structured telemetry providers that surface
49+
typed context (IDs, domains, tenant information) through tracing layers.
50+
51+
See the main [`masterror` README](https://github.com/RAprogramm/masterror/blob/HEAD/README.md) for an end-to-end guide and
52+
advanced examples covering templated display strings, telemetry providers and
53+
OpenAPI/schema integrations.
54+
55+
## License
56+
57+
Licensed under either of
58+
59+
- Apache License, Version 2.0, ([LICENSE-APACHE](https://github.com/RAprogramm/masterror/blob/HEAD/LICENSE-APACHE) or
60+
<https://www.apache.org/licenses/LICENSE-2.0>)
61+
- MIT license ([LICENSE-MIT](https://github.com/RAprogramm/masterror/blob/HEAD/LICENSE-MIT) or <https://opensource.org/licenses/MIT>)
62+
63+
at your option.
64+
65+
Unless you explicitly state otherwise, any contribution intentionally submitted
66+
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
67+
licensed as above, without any additional terms or conditions.
68+

0 commit comments

Comments
 (0)