mirror of
https://github.com/pcvolkmer/osc-variant.git
synced 2025-07-03 09:12:54 +00:00
Show additional information on parsing error
This commit is contained in:
@ -23,7 +23,9 @@
|
||||
*/
|
||||
|
||||
use console::style;
|
||||
use quick_xml::de::from_str;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::str::FromStr;
|
||||
|
||||
use crate::model::data_catalogue::DataCatalogue;
|
||||
use crate::model::data_form::DataForm;
|
||||
@ -96,6 +98,17 @@ impl OnkostarEditor {
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for OnkostarEditor {
|
||||
type Err = String;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match from_str::<OnkostarEditor>(s) {
|
||||
Ok(profile) => Ok(profile),
|
||||
Err(err) => Err(err.to_string()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct InfoXML {
|
||||
|
Reference in New Issue
Block a user