Further to this question's answer. For me, an error occurs when using this code. I want to know exactly what kind of error occurs from the catch block. You're supposed to do this by catching the error's type, but I don't see error types enumerated in the jsonObject documentation
do {
let json = try JSONSerialization.jsonObject(with: data!) as! Dictionary<String, AnyObject>
print(json)
} catch {
print("error") //which error?
}
Is there a way to do this in swift, or how can I find the exceptions an object throws?