js-quantities
js-quantities copied to clipboard
How to get error messages?
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)
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?
See the file: src/quantities/error.js