{"action":"created","issue":{"url":"https://api.github.com/repos/shawnmclean/Mandrill-dotnet/issues/169","repository_url":"https://api.github.com/repos/shawnmclean/Mandrill-dotnet","labels_url":"https://api.github.com/repos/shawnmclean/Mandrill-dotnet/issues/169/labels{/name}","comments_url":"https://api.github.com/repos/shawnmclean/Mandrill-dotnet/issues/169/comments","events_url":"https://api.github.com/repos/shawnmclean/Mandrill-dotnet/issues/169/events","html_url":"https://github.com/shawnmclean/Mandrill-dotnet/issues/169","id":128036234,"number":169,"title":"JSON Error deserializing Mandrill response","user":{"login":"RPM1984","id":930343,"avatar_url":"https://avatars.githubusercontent.com/u/930343?v=3","gravatar_id":"","url":"https://api.github.com/users/RPM1984","html_url":"https://github.com/RPM1984","followers_url":"https://api.github.com/users/RPM1984/followers","following_url":"https://api.github.com/users/RPM1984/following{/other_user}","gists_url":"https://api.github.com/users/RPM1984/gists{/gist_id}","starred_url":"https://api.github.com/users/RPM1984/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RPM1984/subscriptions","organizations_url":"https://api.github.com/users/RPM1984/orgs","repos_url":"https://api.github.com/users/RPM1984/repos","events_url":"https://api.github.com/users/RPM1984/events{/privacy}","received_events_url":"https://api.github.com/users/RPM1984/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-01-21T22:29:58Z","updated_at":"2016-03-15T20:21:14Z","closed_at":"2016-02-16T06:26:26Z","body":"Hey guys,\r\n\r\nEvery now and then, i get this error:\r\n\r\n```\r\nat Newtonsoft.Json.JsonTextReader.ParseValue() \r\nat Newtonsoft.Json.JsonTextReader.Read() \r\nat Newtonsoft.Json.JsonReader.ReadAndMoveToContent() \r\nat Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter) \r\nat Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) \r\nat Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) \r\nat Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) \r\nat Mandrill.MandrillApi.d__2c`1.MoveNext() \r\n\r\n--- End of stack trace from previous location where exception was thrown --- \r\nat System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) \r\nat System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Mandrill.MandrillApi.d__22.MoveNext() \r\nException Message: Unexpected character encountered while parsing value: <. path '', line 0, position 0.. stack trace: \r\nat newtonsoft.json.jsontextreader.parsevalue() newtonsoft.json.jsontextreader.read() newtonsoft.json.jsonreader.readandmovetocontent() newtonsoft.json.serialization.jsonserializerinternalreader.readfortype(jsonreader reader, jsoncontract contract, boolean hasconverter) newtonsoft.json.serialization.jsonserializerinternalreader.deserialize(jsonreader type objecttype, checkadditionalcontent) newtonsoft.json.jsonserializer.deserializeinternal(jsonreader objecttype) newtonsoft.json.jsonconvert.deserializeobject(string value, type, jsonserializersettings settings) newtonsoft.json.jsonconvert.deserializeobject[t](string mandrill.mandrillapi.d__2c`1.MoveNext() \r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) \r\nat System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Mandrill.MandrillApi.d__22.MoveNext() One or more errors occurred.. Stack Trace: at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at \r\n```\r\n\r\nBasically, the pertinent line is this:\r\n```\r\nException Message: Unexpected character encountered while parsing value: <. path '', line 0, position 0.. stack trace: \r\n```\r\n\r\nIt feels like there's a Mandrill error, where an error page is shown (HTML? hence the `<`) and this library is trying to deserialize that into a POCO, and failing.\r\n\r\nAny ideas?\r\n\r\nIf my predictions are correct, i would have thought the library would check for an error code before attempting to de-serialize?\r\n\r\nI can see some code like that [here](https://github.com/shawnmclean/Mandrill-dotnet/blob/master/src/Mandrill/MandrillApi.cs#L88) but i'm not sure if that's whats being called."},"comment":{"url":"https://api.github.com/repos/shawnmclean/Mandrill-dotnet/issues/comments/197005035","html_url":"https://github.com/shawnmclean/Mandrill-dotnet/issues/169#issuecomment-197005035","issue_url":"https://api.github.com/repos/shawnmclean/Mandrill-dotnet/issues/169","id":197005035,"user":{"login":"Scotty79","id":8368273,"avatar_url":"https://avatars.githubusercontent.com/u/8368273?v=3","gravatar_id":"","url":"https://api.github.com/users/Scotty79","html_url":"https://github.com/Scotty79","followers_url":"https://api.github.com/users/Scotty79/followers","following_url":"https://api.github.com/users/Scotty79/following{/other_user}","gists_url":"https://api.github.com/users/Scotty79/gists{/gist_id}","starred_url":"https://api.github.com/users/Scotty79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scotty79/subscriptions","organizations_url":"https://api.github.com/users/Scotty79/orgs","repos_url":"https://api.github.com/users/Scotty79/repos","events_url":"https://api.github.com/users/Scotty79/events{/privacy}","received_events_url":"https://api.github.com/users/Scotty79/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T20:21:14Z","updated_at":"2016-03-15T20:21:14Z","body":"Just got this error as well. Haven't tried 2.4.1 yet as we are mid way through a large email campaign.\r\nAny one know if Mandrill are aware they are returning invalid JSON occasionally?"}}