mirror of
https://github.com/mbilker/kbinxml-rs.git
synced 2026-04-24 06:57:15 -05:00
psmap: fix error handling when using transforms and attribute parsing
This commit is contained in:
parent
6120716be6
commit
3da94cc2e5
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "psmap"
|
||||
version = "1.0.0"
|
||||
version = "1.1.0"
|
||||
authors = ["Matt Bilker <me@mbilker.us>"]
|
||||
license = "MIT"
|
||||
edition = "2018"
|
||||
|
|
@ -8,4 +8,4 @@ edition = "2018"
|
|||
[dependencies]
|
||||
kbinxml = { path = "../kbinxml" }
|
||||
psmap_derive = { path = "../psmap_derive" }
|
||||
thiserror = "1.0.4"
|
||||
thiserror = "1.0.9"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
use kbinxml::KbinError;
|
||||
use std::error::Error;
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
// Re-export proc macro
|
||||
|
|
@ -18,7 +19,7 @@ pub enum PsmapError {
|
|||
attribute: &'static str,
|
||||
source_name: &'static str,
|
||||
struct_name: &'static str,
|
||||
source: KbinError,
|
||||
source: Box<dyn Error + Send + Sync>,
|
||||
},
|
||||
|
||||
#[error("Field `{target}` not found for `{struct_name}`")]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "psmap_derive"
|
||||
version = "1.0.0"
|
||||
version = "1.1.0"
|
||||
authors = ["Matt Bilker <me@mbilker.us>"]
|
||||
license = "MIT"
|
||||
edition = "2018"
|
||||
|
|
|
|||
|
|
@ -430,11 +430,11 @@ impl PsmapOutput {
|
|||
attribute: #attr,
|
||||
source_name: #source,
|
||||
struct_name: stringify!(#struct_name),
|
||||
source,
|
||||
source: Box::new(source),
|
||||
})?);
|
||||
});
|
||||
self.fields.append_all(quote_spanned! {target.span()=>
|
||||
#target: #target.ok_or_else(::psmap::PsmapError::FieldNotFoundFromSource {
|
||||
#target: #target.ok_or(::psmap::PsmapError::FieldNotFoundFromSource {
|
||||
target: stringify!(#target),
|
||||
source_name: #source,
|
||||
struct_name: stringify!(#struct_name),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user