mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-03 06:27:19 +01:00
improve error message in renderer
This commit is contained in:
@@ -14,12 +14,17 @@ async function copyToTemp(id: string, texDocument: string): Promise<void> {
|
||||
await promises.writeFile(docPath, texDocument)
|
||||
}
|
||||
|
||||
async function generateDoc(id: string) {
|
||||
async function generateDoc(id: string): Promise<void> {
|
||||
const { cmd, options } = getTexCmd(id)
|
||||
const { stdout, stderr } = await execPromise(cmd, options)
|
||||
stdout.length && console.log('stdout:', stdout)
|
||||
stderr.length && console.error('error: ', stderr)
|
||||
console.log(`PDF ${id} generated`)
|
||||
try {
|
||||
const { stdout } = await execPromise(cmd, options)
|
||||
stdout.length && console.log('stdout:', stdout)
|
||||
console.log(`PDF ${id} generated`)
|
||||
} catch (error) {
|
||||
console.error(error.stdout)
|
||||
console.error(error.toString())
|
||||
throw new Error(error.message)
|
||||
}
|
||||
}
|
||||
|
||||
export default async function (texDocument: string) {
|
||||
|
||||
Reference in New Issue
Block a user