تخطَّ إلى المحتوى

Unhandled Error In Task (ARCH9031)

هذا المحتوى غير متوفر بلغتك بعد.

Key swift.async.unhandled-error-in-task · Severity warning · Category async

Flags Task { try await ... } where the try is not inside do/catch - the error is silently dropped with the task.

Task { try await sync() }
Task { do { try await sync() } catch { logger.error("sync failed: \(error)") } }

Wrap the body in do/catch, or await the task’s value where the error can be handled.