trifork / cheetah-feedback

https://docs.cheetah.trifork.dev/
0 stars 0 forks source link

[Bug]: Cheetah.WebApi.Shared throws exceptions on opensearch index documents #22

Closed conbos closed 10 months ago

conbos commented 10 months ago

Tell us about the problem

  1. When indexing a document with DateTimeOffset field exception is thrown: System.InvalidCastException Unable to cast object of type 'System.DateTimeOffset' to type 'System.DateTime'. at Cheetah.WebApi.Shared.Util.UtcDateTimeConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)

  2. When indexing a document with unassigned DateTime field exception is thrown: System.ArgumentOutOfRangeException The UTC time represented when the offset is applied must be between year 0 and 10,000. (Parameter 'offset') at System.DateTimeOffset.ValidateDate(DateTime dateTime, TimeSpan offset) at System.DateTimeOffset..ctor(DateTime dateTime) at Cheetah.WebApi.Shared.Util.UtcDateTimeConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)

Stacktrace

No response