Refactor errors
This commit is contained in:
@@ -34,7 +34,13 @@ impl ObjectExtractor for EpubExtractor {
|
||||
args: Option<&str>,
|
||||
) -> Result<Option<PileValue>, std::io::Error> {
|
||||
match (name.as_str(), args) {
|
||||
("text", args) => self.text.field(name, args).await,
|
||||
("text", args) => Ok(Some(
|
||||
self.text
|
||||
.field(name, args)
|
||||
.await
|
||||
.map(|x| x.unwrap_or(PileValue::Null))?,
|
||||
)),
|
||||
|
||||
("meta", None) => Ok(Some(PileValue::ObjectExtractor(self.meta.clone()))),
|
||||
_ => Ok(None),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user