javascript - Output full error object in node.js -


there several places error objects used, when catch errors or in case of exec error object can passed child process. when attempt log information, not quite of makes out.

i've tried following:

console.log(error); console.log(error.stack); console.log(util.inpect(error, true, null)); 

all these options seem output different set of incomplete data. there 1 line way make sure data need see errors displayed or need use 3 of these lines (are there more statements need add?)?

you can convert many javascript objects strings using json:

console.log(json.stringify(error, ["message", "arguments", "type", "name"])); 

edit: updated reflect point made @laggingreflex in comment...


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -