diff --git a/Cargo.lock b/Cargo.lock index 61770fcc..69e7d07a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -342,10 +342,23 @@ version = "0.1.0" dependencies = [ "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "lambda_runtime_core 0.1.0", + "lambda_runtime_errors_derive 0.1.0", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "lambda_runtime_errors_derive" +version = "0.1.0" +dependencies = [ + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "lambda_runtime_errors 0.1.0", + "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "lazy_static" version = "1.2.0" diff --git a/Cargo.toml b/Cargo.toml index a7dff3e7..255cc695 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,5 +3,7 @@ members = [ "lambda-runtime-client", "lambda-runtime-core", "lambda-runtime", - "lambda-http" + "lambda-http", + "lambda-runtime-errors", + "lambda-runtime-errors-derive" ] \ No newline at end of file diff --git a/lambda-runtime-core/Cargo.toml b/lambda-runtime-core/Cargo.toml index 95821ff4..459d3e41 100644 --- a/lambda-runtime-core/Cargo.toml +++ b/lambda-runtime-core/Cargo.toml @@ -7,7 +7,7 @@ keywords = ["AWS", "Lambda", "Runtime", "Rust"] license = "Apache-2.0" homepage = "https://github.com/awslabs/aws-lambda-rust-runtime" repository = "https://github.com/awslabs/aws-lambda-rust-runtime" -documentation = "https://docs.rs/lambda_runtime" +documentation = "https://docs.rs/lambda_runtime_core" edition = "2018" [dependencies] diff --git a/lambda-runtime-errors-derive/Cargo.toml b/lambda-runtime-errors-derive/Cargo.toml index 55a2fb6c..3a58585b 100644 --- a/lambda-runtime-errors-derive/Cargo.toml +++ b/lambda-runtime-errors-derive/Cargo.toml @@ -8,7 +8,7 @@ keywords = ["AWS", "Lambda", "Runtime", "Rust"] license = "Apache-2.0" homepage = "https://github.com/awslabs/aws-lambda-rust-runtime" repository = "https://github.com/awslabs/aws-lambda-rust-runtime" -documentation = "https://docs.rs/lambda_runtime" +documentation = "https://docs.rs/lambda_runtime_errors_derive" [dependencies] syn = "^0.15" diff --git a/lambda-runtime-errors/Cargo.toml b/lambda-runtime-errors/Cargo.toml index c23a2a92..99f26d39 100644 --- a/lambda-runtime-errors/Cargo.toml +++ b/lambda-runtime-errors/Cargo.toml @@ -8,12 +8,13 @@ keywords = ["AWS", "Lambda", "Runtime", "Rust"] license = "Apache-2.0" homepage = "https://github.com/awslabs/aws-lambda-rust-runtime" repository = "https://github.com/awslabs/aws-lambda-rust-runtime" -documentation = "https://docs.rs/lambda_runtime" +documentation = "https://docs.rs/lambda_runtime_errors" [dependencies] log = "^0.4" failure = "^0.1" serde_json = "^1" +lambda_runtime_errors_derive = { path = "../lambda-runtime-errors-derive", version = "^0.1" } [dev-dependencies] lambda_runtime_core = { path = "../lambda-runtime-core", version = "^0.1"} diff --git a/lambda-runtime-errors/src/lib.rs b/lambda-runtime-errors/src/lib.rs index b4cce3c4..13881331 100644 --- a/lambda-runtime-errors/src/lib.rs +++ b/lambda-runtime-errors/src/lib.rs @@ -1,9 +1,21 @@ //! The Lambda runtime errors crate defines the `LambdaErrorExt` trait //! that can be used by libriaries to return errors compatible with the //! AWS Lambda Rust runtime. +//! +//! This crate also exports the `lambda_runtime_errors_derive` crate to +//! derive the `LambdaErrorExt` trait. +//! +//! ```rust,no-run +//! use lambda_runtime_errors::*; +//! +//! // the generated error_type() method returns "crate::LambdaError" +//! #[derive(LambdaErrorExt)] +//! struct LambdaError; +//! ``` mod error_ext_impl; pub use crate::error_ext_impl::*; +pub use lambda_runtime_errors_derive::*; use failure::{format_err, Compat, Error, Fail}; use std::fmt;