[package]
name = "orion-error"
version = "0.7.0" #@gxl:set(version)
edition = "2021"
authors = ["wukong <sec-wukong@outlook.com>"]
description = "Struct Error for Large Project"
license = "MIT"
repository = "https://github.com/galaxy-sec/orion-error"
keywords = ["error", "utilities"]
categories = ["rust-patterns"]

[features]
default = ["log", "derive"]
# Derive macros for `ErrorCode` and `ErrorIdentityProvider`.
derive = ["dep:orion-error-derive"]
# 启用 log 日志集成（与 `OperationContext` 的日志方法和 Drop 输出相关）
log = ["dep:log"]
# tracing 日志集成
tracing = ["dep:tracing"]
serde = ["dep:serde"]
anyhow = ["dep:anyhow"]
serde_json = ["dep:serde_json"]
toml = ["dep:toml"]

[dependencies]
orion-error-derive = { version = "0.7.0", path = "orion-error-derive", optional = true }
thiserror = "2.0"
serde = { version = "1.0", features = ["derive", "rc"], optional = true }
derive_more = { version = "2.1", features = ["from"] }
log = { version = "0.4", optional = true }
tracing = { version = "0.1", optional = true }
anyhow = { version = "1.0", optional = true }
serde_json = { version = "1.0", optional = true }
toml = { version = "0.8", optional = true }


[dev-dependencies]
parse-display-derive = "0.10"
serde_json = "1.0"
env_logger = "0.11"

[[example]]
name = "order_case"
required-features = ["derive"]
