Skip to content

Commit

Permalink
Extract error message/stack
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Aug 20, 2023
1 parent 867c220 commit b0edc35
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mermaid/src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ export class Worker {
const { svg } = await window.mermaid.render('container', definition)
return { svg, error: null }
} catch (err) {
return { svg: null, error: err }
return {
svg: null, error: {
message: 'message' in err && err.message,
stack: 'stack' in err && err.stack,
}
}
}
}, task.source, mermaidConfig)
successfulSpan(span)
Expand Down

0 comments on commit b0edc35

Please sign in to comment.