mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-02-25 16:06:26 +08:00
refactor: throw an error object instead of string
This commit is contained in:
parent
a14cac6d5c
commit
4112fa532e
1 changed files with 1 additions and 1 deletions
|
@ -73,7 +73,7 @@ function onDateInputChanged(value: string) {
|
|||
const formatted: Date | string = toDate(value)
|
||||
|
||||
if (!isDate(formatted) || isNaN(formatted.getTime())) {
|
||||
throw 'invalid date'
|
||||
throw new Error('Invalid date')
|
||||
}
|
||||
|
||||
baseDate.value = formatted
|
||||
|
|
Loading…
Reference in a new issue