{"author_name":"gurrium","image_url":null,"url":"https://giarrium.hatenablog.com/entry/2021/08/13/210259","published":"2021-08-13 21:02:59","version":"1.0","blog_url":"https://giarrium.hatenablog.com/","blog_title":"\u305c\u306e\u305c","type":"rich","author_url":"https://blog.hatena.ne.jp/gurrium/","title":"61\u65e5\u76ee","categories":["Swift"],"provider_url":"https://hatena.blog","provider_name":"Hatena Blog","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgiarrium.hatenablog.com%2Fentry%2F2021%2F08%2F13%2F210259\" title=\"61\u65e5\u76ee - \u305c\u306e\u305c\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","description":"\u65e5\u8a18 \u4eca\u65e5\u306f\u75b2\u308c\u305f\uff0e\u4ed5\u4e8b\u3063\u3066\u96e3\u3057\u3044\u306d\uff0e \u4eca\u65e5\u66f8\u3044\u305f\u30b3\u30fc\u30c9 struct DummyError: Error {} let closureCanThrow = { defer { print(\"first defer\") } defer { print(\"second defer\") } if Bool.random() { print(\"throws DummyError\") throw DummyError() } print(\"not thrown\") } for i in 1...4 { print(i) try? closureCanThrow() } // 1 // throws D\u2026","width":"100%"}