internalfx / quickshot

A Shopify theme development tool.
ISC License
107 stars 18 forks source link

[Watch] Fix Error reporting #50

Closed rickydazla closed 6 years ago

rickydazla commented 6 years ago

I believe that since the err originates from Shopify API, there is no stack, so err.stack results in undefined log call. This fix results in error reporting like this instead...

{"asset":["Liquid syntax error (line 49): Unknown tag 'endunless'"]}
{"key":"snippets/account-form-login.liquid"}
internalfx commented 6 years ago

IIRC sometimes err.stack was the useful information....

maybe this....

if (err.stack != null) {
  log(err.stack)
} else {
  log(err)
}

Hope that helps.

rickydazla commented 6 years ago

@internalfx ok I altered it per your suggestion and seeing similar logic over here

FWIW this was related to https://github.com/internalfx/quickshot/issues/29 and https://github.com/internalfx/quickshot/issues/44 which were closed via https://github.com/internalfx/quickshot/commit/834887bf6d7502ff9d68e77432bc0110e0bef70d but which didn't actually resolve the issue(s).