js-quantities icon indicating copy to clipboard operation
js-quantities copied to clipboard

How to get error messages?

Open librilex opened this issue 8 years ago • 2 comments
trafficstars

Hi, I just started to work with js-quantities and haven't figured out how to get error messages. If something goes wrong (e.g. when Qty('1 Amporia') was entered), only the message [object] [Object] appears in the console of my web browser (Firefox). It would be nice if I could get more information on what went wrong if an error occurs.

(tested with v1.6.6)

librilex avatar Feb 25 '17 16:02 librilex

The error thrown is not a string. It is an object with members name, message, and stack. Maybe try printing out the errors message property?

rage-shadowman avatar Mar 04 '17 00:03 rage-shadowman

See the file: src/quantities/error.js

rage-shadowman avatar Mar 04 '17 00:03 rage-shadowman