<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>keichanzahorumon0405</author_name>
  <author_url>https://blog.hatena.ne.jp/keichanzahorumon0405/</author_url>
  <blog_title>技術開発日記</blog_title>
  <blog_url>https://kechanzahorumon.hatenadiary.com/</blog_url>
  <categories>
    <anon>Junit</anon>
  </categories>
  <description>JUnitで例外が発生する場合のテストを書くとき、throwsするべきかtry/catchするべきかを 悩んでいる場合、特別な理由が無い限りはthrowsにするべきという指摘を頂いた。じゃ、なんでtry/catchではなくthrowsのがいいか。１．コードが綺麗になる。 ２．エラー出力の内容がより詳細まず１。 以下のコードを見ると確かにthrowsしている方が簡潔で綺麗。try/catch @Test public void testSample1() { try { target.check(); } catch (Exception e) { fail(); } } throws @Tes…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkechanzahorumon.hatenadiary.com%2Fentry%2F2013%2F02%2F22%2F113727&quot; title=&quot;throwsするべきかtry/catchするべきか - 技術開発日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2013-02-22 11:37:27</published>
  <title>throwsするべきかtry/catchするべきか</title>
  <type>rich</type>
  <url>https://kechanzahorumon.hatenadiary.com/entry/2013/02/22/113727</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
