【发布时间】:2020-02-10 19:42:39
【问题描述】:
根据可用的 API 和 Apple Documentation Process.run 方法可能会抛出异常。我想处理潜在的异常,但我找不到任何关于这些异常可能是什么的文档。
如何查找相关文档并处理Process.run 异常?
示例代码:
func runProcess(process: Process) {
do {
try process.run()
} catch ??? {
// I don't know what exceptions can I catch here
} catch {
// If I use catch-all case, then the `error` object contains only
// `localizedDescription` which doesn't help in handling errors either
}
}
【问题讨论】:
标签: swift macos cocoa exception process