Expose LuxonError and all its subclasses
Author: NorthLakeCreated Jan 18, 2026Updated Mar 23, 2026
Labelsv4
Is your feature request related to a problem? Please describe.
I have Settings.throwOnInvalid set to true, so that I always know to handle invalid time objects immediately. However, if I want to check wether an error is actually an Invalid[..]Error (DateTime/Interval/etc.), I can't do that by checking the instance of the error. That's because the error classes themselves aren't exposed and therefore cannot be imported. So I'd either have to assume the error is an Invalid[..]Error, or I have to use a hacky way to check the type through the prototype.
Describe the solution you'd like Please expose LuxonError and all its subclasses
Source: moment/luxon