I'm trying to update an NSError
object with more information. For example, an api call may fail and I want to update the error object returned from the api class with view controller information (method name that caused error, client message, any additional info). There isn't a setter method for the UserInfo
dictionary and trying to set a value for the dictionary raises an exception (Not key value code compliant I believe). I thought about creating a new NSError
object with the updated user info, but I wasn't sure if I might lose information.
Question
What's the best way to update the user info dictionary of an NSError object?