<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mtkasima</author_name>
  <author_url>https://blog.hatena.ne.jp/mtkasima/</author_url>
  <blog_title>Timee Product Team Blog</blog_title>
  <blog_url>https://tech.timee.co.jp/</blog_url>
  <categories>
  </categories>
  <description>はじめましてこんにちは。 夏が本気を出してきて最近麺類しか口にしていないサーバサイドエンジニアのかしまです。 この度APIにてHTTP Status Codeとは別に、例外に対応するエラーコードを返すよう奮闘したのでその知見を共有したいと思います。 やりたいこと APIにて例外が発生した場合、以下の形式でレスポンスを返すようにします。 { &quot;errors&quot;: [ { &quot;code&quot;: &quot;code1&quot;, &quot;message&quot;: &quot;message1&quot;, }, { &quot;code&quot;: &quot;code2&quot;, &quot;message&quot;: &quot;message2&quot;, }, ] } Why？ 今回追加したAPIは外部のアプリケー…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftech.timee.co.jp%2Fentry%2F2020%2F08%2F11%2F182724&quot; title=&quot;RailsのAPIサーバーのエラーレスポンスで例外に対応するエラーコードを返却する - Timee Product Team Blog&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>2020-08-11 18:27:24</published>
  <title>RailsのAPIサーバーのエラーレスポンスで例外に対応するエラーコードを返却する</title>
  <type>rich</type>
  <url>https://tech.timee.co.jp/entry/2020/08/11/182724</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
