resend / resend-java

Resend's Java SDK
MIT License
24 stars 1 forks source link

Cannot retrieve anything #35

Closed raintean closed 2 months ago

raintean commented 3 months ago

Cannot retrieve anything, because OffsetDateTime parse error.

Caused by: java.io.IOException: Error parsing OffsetDateTime: 2024-08-26 xx:xx:xx.123456+00
    at com.resend.core.util.DateTimeDeserializer.deserialize(DateTimeDeserializer.java:33)
    at com.resend.core.util.DateTimeDeserializer.deserialize(DateTimeDeserializer.java:15)
    at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:138)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:359)
    ... 70 more
Caused by: java.time.format.DateTimeParseException: Text '2024-08-26 xx:xx:xx.123456+00' could not be parsed at index 10
    at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2052)
    at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1954)
    at java.base/java.time.OffsetDateTime.parse(OffsetDateTime.java:404)
    at java.base/java.time.OffsetDateTime.parse(OffsetDateTime.java:389)
    at com.resend.core.util.DateTimeDeserializer.deserialize(DateTimeDeserializer.java:30)
    ... 75 more

xx just a mask. My computer in GMT+8 and language is zh-CN.

kewynakshlley commented 3 months ago

Try using version 4.0.0. We are no longer using OffsetDateTime, all dates are handled as strings. So, for instance, in case you want to send a scheduled e-mail it will be necessary to generate a date in the ISO 8601 format and parse it to string.

https://resend.com/docs/dashboard/emails/schedule-email