Undescriptive server error when trying to queue a task in the past / improper date
I had a hard time getting up and running with this project and was hoping you could add some more helpful error handling on the backend to make the DX better?
To reproduce:
const runAt = new Date('Jan 1 2001')
await EmailQueue.enqueue({}, { runAt })
and
const runAt = { _seconds: 1608164625, _nanoseconds: 119000000 } // Firebase Firestore Date on record retrieval
await EmailQueue.enqueue({}, { runAt })
Output:
Error: Unexpected status: 500
Would be great to see errors like "Items can not be queued to run in the past" or "Your runAt date is not in the correct format", etc...
Uhh, apologies for the bad experience. I assume you're not using TypeScript, right? Until now, I (somehow) just assumed that providing types would be enough. Having actual development runtime checks make a whole lot of sense! I'll add some developer-focused error messages for that :)
We are using Typescript. There was a bug in the definition file from firebase that was typing their Timestamp as a Date. Thanks!