I’m currently building a Vue-based webapp based around BPMNLint. For that purpose I’m running an Express.JS backend where BPMNLint is located. Vue is sending a bpmn file to that server using axios.
This is my current backend setup:
Unfortunately, it’s returning both the result from the Linter but also an error.
I’m wondering what’s going on here. I could just return stdout in the response ofc since it seems to be working anyways, but it randomly erroring out just bothers me immensely.
bpmnlint exits with 1 when any error occurs or when number of warnings exceeds the maximum value. This causes the exec function to report error (Child process | Node.js v19.0.1 Documentation. Note that this allows to easily adopt bpmnlint in your CI pipeline. It is also quite similar to how eslint works.
It looks like I forgot how a Linter is supposed to work, even though I was using eslint in my project. Is there anything you can recommend in terms of response handling when using bpmnlint as a “standalone” application? Juggling the reply as a string might eventually work how I intend it to, but it’s far from elegant.