-
Notifications
You must be signed in to change notification settings - Fork 160
Open
Description
I wanted to do a generic log-error on htmx errors, and include a timestamp to make it easier to find in logs. However until #123 is fixed, I need to use the basic js date function. To get an Iso Timestamp it seemed easy to do something like this: (new Date()).toISOString()
giving me the following code:
<body
_="on htmx:responseError or htmx:sendError or htmx:sseError log detail then alert(`An unhandled exception occured - please screenshot me: \n${(new Date()).toISOString()}\n${detail.error}`)"
>
However the (great) hyperscript parser seems to dislike the (
inside a curly:
hyperscript errors were found on the following element:
<body _="on htmx:responseError or…()}\\n${detail.error}`)">
Expected ')' but found 'Date'
${(new Date()).toISOString()}
Is this a known bug or should i do something completely different?
Metadata
Metadata
Assignees
Labels
No labels