refactor: throw an error object instead of string
This commit is contained in:
1 file changed
+1
-1
@@ -73,7 +73,7 @@ function onDateInputChanged(value: string) {
|
|||||||
const formatted: Date | string = toDate(value)
|
const formatted: Date | string = toDate(value)
|
||||||
|
|
||||||
if (!isDate(formatted) || isNaN(formatted.getTime())) {
|
if (!isDate(formatted) || isNaN(formatted.getTime())) {
|
||||||
throw 'invalid date'
|
throw new Error('Invalid date')
|
||||||
}
|
}
|
||||||
|
|
||||||
baseDate.value = formatted
|
baseDate.value = formatted
|
||||||
|
|||||||
Reference in new issue
Block a user