tolu / ISO8601-duration

Node/Js-module for parsing and making sense of ISO8601-durations
92 stars 10 forks source link

Wrap parse in try/catch #10

Closed bhishp closed 3 years ago

bhishp commented 6 years ago

Parse will throw an exception with invalid input (durationString is undefined | empty | invalid iso string). Wrapping in try/catch will handle these gracefully.

tolu commented 5 years ago

Sorry for the VERY late reply. I think I prefer if the function throws so that you'll have to handle the exception in the calling code.