Closed tisonkun closed 2 months ago
Not sure why we have this check ..
The panic is occurring here because you're using the +
operator, which specifically panics when checked_add
fails. So if you want to deal with error conditions gracefully, then you should use checked_add
. And checked_add
documents this error condition. You can't add days or greater units to a Timestamp
because the meaning of "day" is ambiguous in this context.
The error message here is pretty abysmal though. So we should improve that.
panic:
Code: