根据可用的 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
}
}
Error
都可以转换为NSError
。 - Martin R