Skip to content

Commit

Permalink
dev: report errors during compilation (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin authored Dec 14, 2023
1 parent 4dedb52 commit 5b03eba
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cli/src/render/typst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ impl TypstRenderer {
self.setup_entry(path);
self.set_theme_target("");

self.compiler
.pure_compile(&mut self.fork_env::<true>())
.map_err(|_| error_once!("compile book.typ"))
let res = self.compiler.pure_compile(&mut self.fork_env::<true>());
self.report(res)
.ok_or_else(|| error_once!("compile book.typ"))
}

pub fn compile_page(&mut self, path: &Path) -> ZResult<()> {
Expand Down Expand Up @@ -182,9 +182,9 @@ impl TypstRenderer {
LayoutRegionNode::Pages(Arc::new((meta, pages)))
});

self.compiler
.compile(&mut self.fork_env::<true>())
.map_err(|_| error_once!("compile page theme", theme: theme))?;
let res = self.compiler.compile(&mut self.fork_env::<true>());
self.report(res)
.ok_or_else(|| error_once!("compile page theme", theme: theme))?;
}

Ok(())
Expand Down

0 comments on commit 5b03eba

Please sign in to comment.