NetworkError: implement optional raw `Data`
So now you're also able to parse error response data if needed
.onError { error in
switch error.code {
case .notFound: print("It's not found :(")
default:
print("Another error happened: " + error.description)
if let raw = error.raw, let rawResponse = String(data: raw, encoding: .utf8) {
print("Raw response: " + rawResponse)
}
}
}