evermeer / EVReflection

Reflection based (Dictionary, CKRecord, NSManagedObject, Realm, JSON and XML) object mapping with extensions for Alamofire and Moya with RxSwift or ReactiveSwift
Other
966 stars 119 forks source link

"Invalid json! The data couldn't be read ... " #290

Closed daerimin closed 6 years ago

daerimin commented 6 years ago

Hello again! I wanted to see if it was somehow possible to run down what is causing a stream of these errors in my code. Everything SEEMS to work as expected, but upon most transactions with my server, I am seeing a long stream of these errors in the console. I have looked at the incoming JSON and I don't see anything wrong with it. Would it be possible to output a File & line number in the error message, or perhaps an option to cause this to throw an exception so I could see where the errors are coming from?

Thanks!

evermeer commented 6 years ago

In EVReflection this error can come from 3 places dictionaryFromJson, dictionaryArrayFromJson or arrayFromData. If you search for the text 'invalid json' you will find these and you could set a breakpoint on those.

It's strange that you say that everything seems to work. It should return no data if that error happened.

daerimin commented 6 years ago

Well, I don't get any exceptions - but I will definitely do what you suggest here.

evermeer commented 6 years ago

Is this still an issue?

daerimin commented 6 years ago

My apologies for failing to close this issue. I found that the library has changed a bit from when I first implemented these things a year ago, and I had to re-write portions of my code to make it work. Thank you again for your help!!