<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tototoshi</author_name>
  <author_url>https://blog.hatena.ne.jp/tototoshi/</author_url>
  <blog_title>tototoshi の日記</blog_title>
  <blog_url>https://tototoshi.hatenablog.com/</blog_url>
  <categories>
    <anon>Scala</anon>
  </categories>
  <description>Scalaで独自の例外を定義する場合 class MyException(message: String) extends RuntimeException(message) と case class MyException(message: String) extends RuntimeException(message) のどちらが良いでしょうか。タイトルで言っちゃってますが、まずほとんどの場合はcase classではなくclassを使う方が良いと思います。 case classにすると等価性がそのインスタンスの属性によって判断されるので、同じ属性を持っている例外は同じものと見なされます…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftototoshi.hatenablog.com%2Fentry%2F2018%2F12%2F07%2F192534&quot; title=&quot;例外をcase classとして定義してはいけない - tototoshi の日記&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>2018-12-07 19:25:34</published>
  <title>例外をcase classとして定義してはいけない</title>
  <type>rich</type>
  <url>https://tototoshi.hatenablog.com/entry/2018/12/07/192534</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
