**
I m trying to use make @escaping function to async/await with withUnsafeThrowingContinuation, but there is error Type of expression is ambiguous without more context**
private func asyncUpload() async {
guard let image = self.manager?.getUserModel()?.image else { return }
let body = SetAvatarRequest(username: UserManager.shared.username, image: image)
do {
try await withUnsafeThrowingContinuation { (continuation: UnsafeContinuation<Void, Error>) in
RESTClient.shared.uploadImage(
fileName: "\(UserManager.shared.username)_avatar",
path: "files/avatar/\(UserManager.shared.userId)",
body: body) { result in
print(result)
switch result {
case .success:
UserManager.shared.setImage(image)
continuation.resume(returning: ())
self?.removeFromFailed(type: type)
case let .failure(error):
print("DEBUG: \(error.localizedDescription)")
continuation.resume(throwing: error)
}
}
} as Void
} catch {
print("error")
}
}```




