{"id":6463,"date":"2026-04-16T13:42:18","date_gmt":"2026-04-16T04:42:18","guid":{"rendered":"https:\/\/route-zero.com\/recruit\/?post_type=route&#038;p=6463"},"modified":"2026-10-16T13:42:26","modified_gmt":"2026-10-16T04:42:26","slug":"javascript-fetch-404-500-response-ok-catch","status":"publish","type":"route","link":"https:\/\/route-zero.com\/recruit\/route\/6463\/","title":{"rendered":"fetch\u306e404\u304ccatch\u306b\u5165\u3089\u306a\u3044\u7406\u7531"},"content":{"rendered":"<p>JavaScript\u306efetch\u3067404\u3084500\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u8fd4\u3063\u3066\u304d\u3066\u3082\u3001\u305d\u308c\u3060\u3051\u3067\u306fPromise\u304creject\u3055\u308c\u305a\u3001\u901a\u5e38\u306fcatch\u3078\u5165\u308a\u307e\u305b\u3093\u3002fetch\u306fHTTP\u30a8\u30e9\u30fc\u306eResponse\u3082\u53d7\u3051\u53d6\u308b\u305f\u3081\u3067\u3059\u3002HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u30a8\u30e9\u30fc\u3068\u3057\u3066\u6271\u3044\u305f\u3044\u5834\u5408\u306f\u3001response.ok\u3092\u8abf\u3079\u3001false\u306a\u3089\u81ea\u5206\u3067Error\u3092throw\u3057\u307e\u3059\u3002\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u969c\u5bb3\u3084Abort\u306b\u3088\u308b\u5931\u6557\u3068\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u8fd4\u3057\u305f404\u30fb500\u306f\u533a\u5225\u3057\u3066\u8003\u3048\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>404\u30fb500\u3067\u3082fetch\u306ecatch\u306b\u5165\u3089\u306a\u3044\u7406\u7531<\/h2>\n<p>fetch\u306fHTTP\u901a\u4fe1\u306b\u6210\u529f\u3057\u3066Response\u3092\u53d7\u3051\u53d6\u308c\u305f\u5834\u5408\u3001\u30b9\u30c6\u30fc\u30bf\u30b9\u304c404\u3084500\u3067\u3082Promise\u3092fulfilled\u306b\u3059\u308b\u4ed5\u69d8\u3067\u3059\u3002\u4e00\u65b9\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u969c\u5bb3\u3084\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u4e2d\u65ad\u3055\u308c\u305f\u5834\u5408\u306a\u3069\u306freject\u3055\u308c\u3001catch\u3078\u5230\u9054\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u767a\u751f\u3057\u305f\u72b6\u614b<\/th>\n<th>fetch\u306ePromise<\/th>\n<th>\u5bfe\u5fdc<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>HTTP 200<\/td>\n<td>\u901a\u5e38fulfilled<\/td>\n<td>response.ok=true<\/td>\n<\/tr>\n<tr>\n<td>HTTP 404<\/td>\n<td>\u901a\u5e38fulfilled<\/td>\n<td>response.ok=false\u3092\u78ba\u8a8d<\/td>\n<\/tr>\n<tr>\n<td>HTTP 500<\/td>\n<td>\u901a\u5e38fulfilled<\/td>\n<td>response.ok=false\u3092\u78ba\u8a8d<\/td>\n<\/tr>\n<tr>\n<td>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30fbCORS\u7b49\u306e\u901a\u4fe1\u5931\u6557<\/td>\n<td>reject\u3055\u308c\u5f97\u308b<\/td>\n<td>catch\u3067\u51e6\u7406<\/td>\n<\/tr>\n<tr>\n<td>AbortController\u306b\u3088\u308b\u4e2d\u65ad<\/td>\n<td>AbortError\u7b49\u3068\u3057\u3066reject\u3055\u308c\u5f97\u308b<\/td>\n<td>\u4e2d\u65ad\u3068\u3057\u3066\u533a\u5225<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p><strong>\u7528\u8a9e\u89e3\u8aac\uff1aResponse.ok<\/strong><br \/>\u30ec\u30b9\u30dd\u30f3\u30b9\u306eHTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u304c200\u304b\u3089299\u306e\u7bc4\u56f2\u306a\u3089true\u3002\u305d\u308c\u4ee5\u5916\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u306ffalse\u306b\u306a\u308b\u8aad\u307f\u53d6\u308a\u5c02\u7528\u30d7\u30ed\u30d1\u30c6\u30a3\u3067\u3059\u3002<\/p>\n<\/blockquote>\n<hr>\n<h2>\u8aa4\u89e3\u3057\u3084\u3059\u3044NG\u30b3\u30fc\u30c9<\/h2>\n<p>\u6b21\u306e\u4f8b\u3067\u306f\u30b5\u30fc\u30d0\u30fc\u304c404\u3092\u8fd4\u3057\u3066\u3082\u3001fetch\u305d\u306e\u3082\u306e\u304creject\u3057\u306a\u3044\u305f\u3081\u3001catch\u3078\u5165\u3089\u305a\u300c\u6210\u529f\u300d\u3068\u3057\u3066\u51e6\u7406\u3092\u9032\u3081\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><code>async function loadUser() {\r\n  try {\r\n    const response = await fetch(&quot;\/api\/users\/42&quot;);\r\n    console.log(&quot;\u53d6\u5f97\u6210\u529f&quot;, response.status);\r\n  } catch (error) {\r\n    console.error(&quot;\u30ea\u30af\u30a8\u30b9\u30c8\u5931\u6557&quot;, error);\r\n  }\r\n}<\/code><\/pre>\n<p>try\/catch\u306f\u300cHTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u304c400\u4ee5\u4e0a\u306a\u3089\u81ea\u52d5\u7684\u306b\u4f8b\u5916\u304c\u98db\u3076\u4ed5\u7d44\u307f\u300d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002HTTP\u306e\u6210\u529f\u30fb\u5931\u6557\u3092\u696d\u52d9\u30ed\u30b8\u30c3\u30af\u3068\u3057\u3066\u5224\u5b9a\u3059\u308b\u51e6\u7406\u3092\u660e\u793a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<hr>\n<h2>response.ok\u3092\u4f7f\u3063\u3066HTTP\u30a8\u30e9\u30fc\u3092throw\u3059\u308b<\/h2>\n<pre><code>async function fetchJson(url) {\r\n  const response = await fetch(url);\r\n\r\n  if (!response.ok) {\r\n    throw new Error(&quot;HTTP &quot; + response.status);\r\n  }\r\n\r\n  if (response.status === 204) {\r\n    return null;\r\n  }\r\n\r\n  return await response.json();\r\n}\r\n\r\nasync function showUser() {\r\n  try {\r\n    const user = await fetchJson(&quot;\/api\/users\/42&quot;);\r\n    console.log(user);\r\n  } catch (error) {\r\n    console.error(&quot;API\u53d6\u5f97\u30a8\u30e9\u30fc&quot;, error);\r\n  }\r\n}<\/code><\/pre>\n<p>response.ok\u304cfalse\u306e\u3068\u304d\u81ea\u5206\u3067throw\u3059\u308b\u305f\u3081\u3001\u547c\u3073\u51fa\u3057\u5143\u306ecatch\u3067404\u30fb500\u3092\u307e\u3068\u3081\u3066\u6271\u3048\u307e\u3059\u3002204 No Content\u306e\u5834\u5408\u306f\u672c\u6587\u304c\u306a\u3044\u305f\u3081\u3001\u30b5\u30f3\u30d7\u30eb\u3067\u306fjson()\u3092\u547c\u3070\u305anull\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<p>response.json()\u3082\u975e\u540c\u671f\u3067\u3059\u3002\u30b5\u30fc\u30d0\u30fc\u304c\u4e0d\u6b63\u306aJSON\u3092\u8fd4\u3057\u305f\u5834\u5408\u306a\u3069\u306f\u89e3\u6790\u30a8\u30e9\u30fc\u306b\u306a\u308a\u5f97\u308b\u305f\u3081\u3001HTTP\u30c1\u30a7\u30c3\u30af\u3060\u3051\u3067\u672c\u6587\u306e\u6b63\u5f53\u6027\u3092\u4fdd\u8a3c\u3067\u304d\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<hr>\n<h2>404\u3068500\u306f\u30a8\u30e9\u30fc\u306e\u610f\u5473\u3092\u5206\u3051\u308b<\/h2>\n<p>\u753b\u9762\u3067\u306e\u5bfe\u5fdc\u306f\u30b9\u30c6\u30fc\u30bf\u30b9\u306b\u3088\u3063\u3066\u5909\u308f\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070404\u306f\u5bfe\u8c61\u30ea\u30bd\u30fc\u30b9\u306a\u3057\u3001401\u306f\u8a8d\u8a3c\u306e\u554f\u984c\u3001500\u306f\u30b5\u30fc\u30d0\u30fc\u5185\u90e8\u306e\u554f\u984c\u306a\u3069\u3092\u793a\u3057\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u5411\u3051\u8868\u793a\u3084\u518d\u8a66\u884c\u6761\u4ef6\u306fAPI\u4ed5\u69d8\u306b\u5408\u308f\u305b\u3066\u6c7a\u3081\u307e\u3059\u3002<\/p>\n<pre><code>async function getProfile() {\r\n  const res = await fetch(&quot;\/api\/profile&quot;);\r\n\r\n  if (res.status === 404) {\r\n    return null; \/\/ \u672a\u767b\u9332\u3068\u3057\u3066\u6271\u3046\u8a2d\u8a08\u306e\u4f8b\r\n  }\r\n\r\n  if (res.status === 401) {\r\n    throw new Error(&quot;\u8a8d\u8a3c\u304c\u5fc5\u8981\u3067\u3059&quot;);\r\n  }\r\n\r\n  if (!res.ok) {\r\n    throw new Error(&quot;HTTP &quot; + res.status);\r\n  }\r\n\r\n  return res.json();\r\n}<\/code><\/pre>\n<p>404\u3092\u6b63\u5e38\u306a\u300c\u672a\u767b\u9332\u300d\u3068\u6271\u3046\u304b\u4f8b\u5916\u306b\u3059\u308b\u304b\u306fAPI\u306e\u5951\u7d04\u306b\u3088\u308a\u307e\u3059\u3002\u3059\u3079\u3066\u306eHTTP\u30a8\u30e9\u30fc\u3092\u540c\u3058\u6587\u8a00\u30fb\u540c\u3058\u30ea\u30c8\u30e9\u30a4\u51e6\u7406\u306b\u307e\u3068\u3081\u308b\u3068\u3001\u539f\u56e0\u304c\u8ffd\u3044\u306b\u304f\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a8\u30e9\u30fc\u3068CORS\u306f\u5225\u306e\u554f\u984c<\/h2>\n<p>\u30b5\u30fc\u30d0\u30fc\u304c404\u3092\u8fd4\u3059\u30b1\u30fc\u30b9\u3068\u3001\u30d6\u30e9\u30a6\u30b6\u304cCORS\u5236\u7d04\u3067\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u8aad\u307f\u53d6\u308c\u306a\u3044\u30b1\u30fc\u30b9\u306f\u533a\u5225\u304c\u5fc5\u8981\u3067\u3059\u3002CORS\u306e\u5931\u6557\u3067\u306f\u901a\u5e38\u3001JavaScript\u304b\u3089\u76ee\u7684\u306eHTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u3084\u672c\u6587\u3092\u8aad\u3081\u307e\u305b\u3093\u3002<\/p>\n<ul>\n<li>\u30d6\u30e9\u30a6\u30b6\u306eNetwork\u30bf\u30d6\u3067\u5b9f\u969b\u306bHTTP\u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u8fd4\u3063\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/li>\n<li>\u30b3\u30f3\u30bd\u30fc\u30eb\u306bCORS\u30dd\u30ea\u30b7\u30fc\u9055\u53cd\u304c\u51fa\u3066\u3044\u306a\u3044\u304b\u898b\u308b\u3002<\/li>\n<li>AbortController\u3092\u4f7f\u3046\u51e6\u7406\u306a\u3089\u30e6\u30fc\u30b6\u30fc\u64cd\u4f5c\u306b\u3088\u308b\u30ad\u30e3\u30f3\u30bb\u30eb\u3068\u969c\u5bb3\u3092\u5206\u3051\u308b\u3002<\/li>\n<li>\u969c\u5bb3\u5185\u5bb9\u3092\u753b\u9762\u3078\u305d\u306e\u307e\u307e\u51fa\u3057\u3059\u304e\u305a\u3001\u30ed\u30b0\u306b\u6a5f\u5bc6\u60c5\u5831\u3084\u500b\u4eba\u30c7\u30fc\u30bf\u3092\u6b8b\u3055\u306a\u3044\u3002<\/li>\n<\/ul>\n<p>CORS\u306e\u56de\u907f\u3092\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3067\u7121\u7406\u306b\u884c\u304a\u3046\u3068\u305b\u305a\u3001\u5bfe\u8c61API\u5074\u306e\u8a31\u53ef\u8a2d\u5b9a\u30fb\u8a8d\u8a3c\u30fb\u30ea\u30af\u30a8\u30b9\u30c8\u5143\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u57fa\u672c\u3067\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30fc\u30bf\u30b9\u51e6\u7406\u3092\u30c6\u30b9\u30c8\u3059\u308b\u30dd\u30a4\u30f3\u30c8<\/h2>\n<p>API\u304c\u5e38\u306b200\u3092\u8fd4\u3059\u74b0\u5883\u3060\u3051\u3067\u78ba\u8a8d\u3059\u308b\u3068\u3001404\u30fb500\u306e\u753b\u9762\u8868\u793a\u3092\u898b\u843d\u3068\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002fetch\u3092\u30e2\u30c3\u30af\u5316\u3059\u308b\u304b\u3001\u30c6\u30b9\u30c8\u7528\u30b5\u30fc\u30d0\u30fc\u3067\u30b9\u30c6\u30fc\u30bf\u30b9\u5225\u306e\u52d5\u4f5c\u3092\u691c\u8a3c\u3057\u307e\u3059\u3002<\/p>\n<pre><code>const response404 = new Response(\r\n  JSON.stringify({ message: &quot;Not found&quot; }),\r\n  { status: 404, headers: { &quot;Content-Type&quot;: &quot;application\/json&quot; } }\r\n);\r\n\r\nconsole.log(response404.ok);     \/\/ false\r\nconsole.log(response404.status); \/\/ 404<\/code><\/pre>\n<p>\u4e0a\u8a18\u306eResponse\u306e\u751f\u6210\u4f8b\u306f\u4ed5\u69d8\u3092\u78ba\u8a8d\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u3001\u5b9f\u74b0\u5883\u3067\u81ea\u52d5\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3057\u305f\u8a18\u9332\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u5b9f\u969b\u306e\u901a\u4fe1\u5931\u6557\u306ffetch\u306ePromise\u306ereject\u3082\u542b\u3081\u3066\u5225\u306b\u691c\u8a3c\u3057\u307e\u3059\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u8a66\u9a13\u30b1\u30fc\u30b9<\/th>\n<th>\u671f\u5f85\u3059\u308b\u51e6\u7406<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>200 + \u6b63\u5e38JSON<\/td>\n<td>\u901a\u5e38\u30c7\u30fc\u30bf\u3092\u8868\u793a<\/td>\n<\/tr>\n<tr>\n<td>204 + \u7a7a\u672c\u6587<\/td>\n<td>json()\u3092\u547c\u3070\u305a\u7a7a\u30c7\u30fc\u30bf\u3068\u3057\u3066\u6271\u3046<\/td>\n<\/tr>\n<tr>\n<td>404<\/td>\n<td>\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u672a\u767b\u9332\u8868\u793a\u307e\u305f\u306fthrow<\/td>\n<\/tr>\n<tr>\n<td>500<\/td>\n<td>\u30b5\u30fc\u30d0\u30fc\u30a8\u30e9\u30fc\u3068\u3057\u3066\u8a18\u9332\u30fb\u6848\u5185<\/td>\n<\/tr>\n<tr>\n<td>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5207\u65ad<\/td>\n<td>catch\u7d4c\u7531\u306e\u5931\u6557\u51e6\u7406<\/td>\n<\/tr>\n<tr>\n<td>\u4e0d\u6b63JSON<\/td>\n<td>\u89e3\u6790\u30a8\u30e9\u30fc\u3092\u6355\u6349<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>axios\u3068fetch\u306e\u9055\u3044\u3082\u78ba\u8a8d\u3059\u308b<\/h2>\n<p>axios\u306f\u65e2\u5b9a\u3067HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u306b\u3088\u308b\u5931\u6557\u3092Promise\u306ereject\u3068\u3057\u3066\u6271\u3046\u306e\u306b\u5bfe\u3057\u3001fetch\u3067\u306fresponse.ok\u306e\u660e\u793a\u5224\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u4ed5\u69d8\u5dee\u304c\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5207\u308a\u66ff\u3048\u305f\u969b\u306b\u30a8\u30e9\u30fc\u51e6\u7406\u304c\u5909\u308f\u308b\u5178\u578b\u7684\u306a\u7406\u7531\u3067\u3059\u3002<\/p>\n<p>\uff08axios\u3068fetch\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u9055\u3044\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1861\/\">axios\u3068fetch\u3069\u3063\u3061\u3092\u9078\u3076\uff1fAPI\u9023\u643a\u3067\u5931\u6557\u3057\u306a\u3044\u9078\u5b9a\u30d5\u30ed\u30fc\u3068\u5b9f\u8df5\u30b3\u30fc\u30c9<\/a>\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09<\/p>\n<p>\uff08\u975e\u540c\u671f\u901a\u4fe1\u306e\u57fa\u672c\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1128\/\">JavaScript\u306eAjax\u5b8c\u5168\u5165\u9580\uff5cfetch\u306e\u4f7f\u3044\u65b9\u30fbCORS\u30a8\u30e9\u30fc\u306e\u5bfe\u51e6\u30fb\u975e\u540c\u671f\u901a\u4fe1\u306e\u57fa\u672c\u3092\u89e3\u8aac<\/a>\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09<\/p>\n<p>\uff08CORS\u539f\u56e0\u306e\u5207\u308a\u5206\u3051\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1205\/\">JavaScript\u3067CORS\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u3068\u304d\u306e\u539f\u56e0\u3068\u5bfe\u51e6\u6cd5\u3092\u5fb9\u5e95\u89e3\u8aac<\/a>\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09<\/p>\n<h2>\u3088\u304f\u3042\u308b\u7591\u554f\u3068\u307e\u3068\u3081<\/h2>\n<h3>fetch\u304c404\u3092\u8fd4\u3059\u3068then\u3078\u5165\u308a\u307e\u3059\u304b\uff1f<\/h3>\n<p>\u901a\u5e38\u306f\u5165\u308a\u307e\u3059\u3002HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u304c404\u3067\u3082Response\u3092\u53d7\u3051\u53d6\u308c\u308c\u3070fetch\u306ePromise\u306ffulfilled\u3067\u3059\u3002response.ok\u3067\u5224\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>response.ok\u306etrue\u306f\u4f55\u756a\u304b\u3089\u4f55\u756a\u3067\u3059\u304b\uff1f<\/h3>\n<p>200\u304b\u3089299\u307e\u3067\u306eHTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u3067\u3059\u3002\u305d\u306e\u4ed6\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u3067\u306ffalse\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>catch\u306b\u5165\u308b\u306e\u306f\u3044\u3064\u3067\u3059\u304b\uff1f<\/h3>\n<p>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5931\u6557\u306a\u3069\u3067Promise\u304creject\u3055\u308c\u305f\u5834\u5408\u3084\u3001\u51e6\u7406\u4e2d\u306b\u81ea\u5206\u3067Error\u3092throw\u3057\u305f\u5834\u5408\u3001JSON\u89e3\u6790\u3067\u4f8b\u5916\u304c\u8d77\u304d\u305f\u5834\u5408\u306a\u3069\u3067\u3059\u3002<\/p>\n<p>fetch\u306fHTTP\u30ec\u30b9\u30dd\u30f3\u30b9\u306e404\u30fb500\u3092\u81ea\u52d5\u7684\u306b\u306f\u4f8b\u5916\u306b\u3057\u307e\u305b\u3093\u3002response.ok\u3068status\u3067HTTP\u30ec\u30d9\u30eb\u306e\u7d50\u679c\u3092\u5224\u5b9a\u3057\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5931\u6557\u3084JSON\u89e3\u6790\u5931\u6557\u306ftry\/catch\u3067\u6271\u3046\u3001\u3068\u5f79\u5272\u3092\u5206\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u306f\u73fe\u5728\u306efetch\u30b3\u30fc\u30c9\u3067response.ok\u3092\u78ba\u8a8d\u3057\u3066\u3044\u308b\u304b\u3001404\u6642\u306b\u3069\u3046\u52d5\u304f\u304b\u3092\u30c6\u30b9\u30c8\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"featured_media":6466,"template":"","meta":{"ssp_meta_title":"fetch\u3067404\u30fb500\u304ccatch\u306b\u5165\u3089\u306a\u3044\u7406\u7531\uff5cresponse.ok\u3068HTTP\u30a8\u30e9\u30fc","ssp_meta_description":"fetch\u3067404\u30fb500\u304ccatch\u306b\u5165\u3089\u306a\u3044\u7406\u7531\u3092\u89e3\u8aac\u3002response.ok\u3067HTTP\u30a8\u30e9\u30fc\u3092\u5224\u5b9a\u3057\u3001throw\u3059\u308b\u65b9\u6cd5\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u969c\u5bb3\u3084JSON\u89e3\u6790\u30a8\u30e9\u30fc\u3068\u306e\u9055\u3044\u3001\u30c6\u30b9\u30c8\u624b\u9806\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002","ssp_meta_keyword":"JavaScript fetch 404 catch response.ok,fetch 500 catch,response.ok \u4f7f\u3044\u65b9,fetch HTTP \u30a8\u30e9\u30fc,fetch 204 JSON,fetch \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a8\u30e9\u30fc","ssp_meta_canonical":""},"route_category":[9],"_links":{"self":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route\/6463"}],"collection":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route"}],"about":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/types\/route"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media\/6466"}],"wp:attachment":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media?parent=6463"}],"wp:term":[{"taxonomy":"route_category","embeddable":true,"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route_category?post=6463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}