Refactor errors

This commit is contained in:
2026-03-12 23:04:59 -07:00
parent 60483dd53d
commit 26a428dedc
17 changed files with 192 additions and 161 deletions

View File

@@ -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),
}