kaishuu0123/vscode-erd

Error message not showing on preview. (for erd version 0.2.0)

adamist521 opened this issue · 0 comments

What's going on

Error from erd v0.2.0 is not shown in preview (screenshot below).
image

Cause

It is due to that erd outputs error to stderr instead of stdout which assumed to be the old implementation and that causes error messages not shown in preview of VSCode.

Temporaly Solution (&problem)

As a temporaly solution, changing .stdout to .stderr in the following code will output message on preview.
(One thing I have to mention is that changing code would make erd-go v1.4.3 not showing error message so (unless you put both stdout and stderr))

// for Error handing
let erdStdout = '';
erdProcess
.stdout
.on('data', (data) => {
if (data.toString().length > 0) {
erdStdout += data.toString()
}
});

image