brandonseydel/MailChimp.Net

Exception when Get Info for an UnScheduled campaign (Could not convert string to DateTime: -001-11-30T00:00:00+00:00)

Closed this issue · 1 comments

Hello,

We are using version: 5.2.0

I have the following scenario:

  • Campaign in Draft mode
  • Get info
  • Schedule
  • UnSchedule
  • Get Info - Exception occurred
  • Get All - Exception occurred (Same exception)

This is our code:

var campaign = await manager.Campaigns.GetAsync("XXXXXXX").ConfigureAwait(false);

await manager.Campaigns.ScheduleAsync("XXXXXXX", new CampaignScheduleRequest()
{
    ScheduleTime = "2021-10-30 10:15:00"
}).ConfigureAwait(false);

await manager.Campaigns.UnscheduleAsync("XXXXXXX").ConfigureAwait(false);

campaign = await manager.Campaigns.GetAsync("XXXXXXX").ConfigureAwait(false);

Exception details:
Message: Could not convert string to DateTime: -001-11-30T00:00:00+00:00. Path 'send_time', line 1, position 306.

Stack Trace: at Newtonsoft.Json.JsonReader.ReadDateTimeString(String s)
at Newtonsoft.Json.JsonTextReader.FinishReadQuotedStringValue(ReadType readType)
at Newtonsoft.Json.JsonTextReader.ReadAsDateTime()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
at MailChimp.Net.HttpContentExtensions.d__01.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at MailChimp.Net.Logic.CampaignLogic.d__11.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at TryMailchimp.Program.d__1.MoveNext()

Is there any way to bypass such behavior?

Kind regards,
Konstantinos

Stale issue message