{"id":40572,"date":"2025-12-15T12:58:16","date_gmt":"2025-12-15T12:58:16","guid":{"rendered":"https:\/\/www.railscarma.com\/?p=40572"},"modified":"2025-12-15T12:58:22","modified_gmt":"2025-12-15T12:58:22","slug":"ruby-try-catch-%e3%81%ae%e8%aa%ac%e6%98%8e-ruby-%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8b%e4%be%8b%e5%a4%96%e5%87%a6%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/ruby-try-catch-%e3%81%ae%e8%aa%ac%e6%98%8e-ruby-%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8b%e4%be%8b%e5%a4%96%e5%87%a6%e7%90%86\/","title":{"rendered":"Ruby Try Catch Explained\uff1aRuby\u306e\u4f8b\u5916\u51e6\u7406\u306e\u4ed5\u7d44\u307f"},"content":{"rendered":"<div data-elementor-type=\"wp-post\" data-elementor-id=\"40572\" class=\"elementor elementor-40572\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-efd2e11 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"efd2e11\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2a6b3c9\" data-id=\"2a6b3c9\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-f11f099 elementor-widget elementor-widget-text-editor\" data-id=\"f11f099\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"font-weight: 400;\">\u4f8b\u5916\u51e6\u7406\u306f\u3001\u3069\u306e\u8a00\u8a9e\u3067\u3082\u5805\u7262\u306a\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u57fa\u672c\u3067\u3042\u308a\u3001Ruby\u3082\u4f8b\u5916\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002Ruby\u3067\u306f\u3001\u30bc\u30ed\u9664\u7b97\u3001\u672a\u5b9a\u7fa9\u306e\u5909\u6570\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u30aa\u30fc\u30d7\u30f3\u5931\u6557\u306a\u3069\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u4e2d\u306b\u767a\u751f\u3059\u308b\u30a8\u30e9\u30fc\u3084\u4e88\u671f\u305b\u306c\u72b6\u6cc1\u3092\u4f8b\u5916\u3068\u547c\u3073\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u4f8b\u5916\u3092\u9069\u5207\u306b\u51e6\u7406\u3057\u306a\u3044\u3068\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u3001\u30e6\u30fc\u30b6\u4f53\u9a13\u306e\u4f4e\u4e0b\u3084\u30b7\u30b9\u30c6\u30e0\u969c\u5bb3\u306b\u3064\u306a\u304c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u3053\u3067Ruby\u306e\u4f8b\u5916\u51e6\u7406\u30e1\u30ab\u30cb\u30ba\u30e0\u304c\u6d3b\u8e8d\u3057\u307e\u3059\u3002 <\/span><a href=\"https:\/\/www.railscarma.com\/ja\/ruby-on-rails-%e9%96%8b%e7%99%ba%e8%80%85%e3%82%92%e9%9b%87%e3%81%86\/\"><span style=\"font-weight: 400;\">\u958b\u767a\u8005<\/span><\/a><span style=\"font-weight: 400;\"> \u30a8\u30e9\u30fc\u3092\u512a\u96c5\u306b\u7ba1\u7406\u3057\u3001\u30a8\u30e9\u30fc\u304b\u3089\u56de\u5fa9\u3057\u3001\u610f\u5473\u306e\u3042\u308b\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u3092\u63d0\u4f9b\u3059\u308b\u3002.<\/span><\/p><p><span style=\"font-weight: 400;\">Ruby\u3067\u306f\u3001Java\u3084JavaScript\u3067\u304a\u306a\u3058\u307f\u306e\u300ctry-catch\u300d\u69cb\u6587\u304c\u4f7f\u308f\u308c\u3066\u3044\u306a\u3044\u3053\u3068\u306f\u3001\u6700\u521d\u306b\u8a00\u3063\u3066\u304a\u304f\u4fa1\u5024\u304c\u3042\u308b\u3002\u305d\u306e\u4ee3\u308f\u308a\u306b\u3001Ruby\u3067\u306f <\/span><span style=\"font-weight: 400;\"><code>begin\u3001rescue\u3001else<\/code><\/span> \u305d\u3057\u3066 <span style=\"font-weight: 400;\"><code>\u78ba\u4fdd\u3059\u308b<\/code><\/span><span style=\"font-weight: 400;\"> \u30d6\u30ed\u30c3\u30af\u3092\u4f7f\u7528\u3059\u308b\u3002\u3057\u304b\u3057\u3001\u201ctry-catch \u201d\u3068\u3044\u3046\u7528\u8a9e\u306f\u3001\u4ed6\u306e\u8a00\u8a9e\u3068\u306e\u985e\u4f3c\u6027\u3092\u793a\u3059\u305f\u3081\u306b\u3001\u3053\u306e\u30d7\u30ed\u30bb\u30b9\u3092\u8aac\u660e\u3059\u308b\u305f\u3081\u306b\u3057\u3070\u3057\u3070\u53e3\u8a9e\u7684\u306b\u4f7f\u308f\u308c\u307e\u3059\u3002\u3053\u306e\u5305\u62ec\u7684\u306a\u8a18\u4e8b\u3067\u306f\u3001Ruby\u306e\u4f8b\u5916\u51e6\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u89e3\u660e\u3057\u3001\u305d\u306e\u69cb\u6587\u3001\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3001\u9ad8\u5ea6\u306a\u6a5f\u80fd\u3001\u305d\u3057\u3066\u5b9f\u969b\u306e\u5fdc\u7528\u4f8b\u3092\u63a2\u308a\u307e\u3059\u3002\u6700\u5f8c\u306b\u306f\u3001Ruby\u30b3\u30fc\u30c9\u306b\u52b9\u679c\u7684\u306a\u30a8\u30e9\u30fc\u7ba1\u7406\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u3092\u6df1\u304f\u7406\u89e3\u3057\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u56de\u5fa9\u529b\u3068\u4fdd\u5b88\u6027\u3092\u78ba\u4fdd\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002.<\/span><\/p><h3><b>Ruby\u306e\u4f8b\u5916\u3092\u7406\u89e3\u3059\u308b<\/b><\/h3><p>\u4f8b\u5916\u51e6\u7406\u306e\u4ed5\u7d44\u307f\u306b\u5165\u308b\u524d\u306b\u3001Ruby\u306b\u304a\u3051\u308b\u4f8b\u5916\u3068\u306f\u4f55\u304b\u3092\u628a\u63e1\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308b\u3002\u4f8b\u5916\u306f <code>\u4f8b\u5916<\/code> \u30af\u30e9\u30b9\u306f\u3001Ruby\u306e\u3059\u3079\u3066\u306e\u4f8b\u5916\u306e\u57fa\u5e95\u30af\u30e9\u30b9\u3067\u3059\u3002\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3068\u3001Ruby\u306f\u9069\u5207\u306a\u4f8b\u5916\u30b5\u30d6\u30af\u30e9\u30b9\uff08\u305f\u3068\u3048\u3070 <code>\u30bc\u30ed\u9664\u7b97\u30a8\u30e9\u30fc<\/code> \u307e\u305f\u306f <code>\u30e1\u30bd\u30c3\u30c9\u30a8\u30e9\u30fc<\/code>)\u3092 \u201c\u30ec\u30a4\u30ba \u201d\u3057\u3001\u901a\u5e38\u306e\u5b9f\u884c\u30d5\u30ed\u30fc\u3092\u4e2d\u65ad\u3055\u305b\u308b\u3002.<\/p><p>Ruby\u306e\u4f8b\u5916\u968e\u5c64\u306f\u3088\u304f\u6574\u7406\u3055\u308c\u3066\u3044\u308b\u3002\u6700\u4e0a\u4f4d\u306f <code>\u4f8b\u5916<\/code>, \u306a\u3069\u306e\u4e3b\u8981\u652f\u5e97\u3092\u6301\u3064\u3002 <code>\u6a19\u6e96\u30a8\u30e9\u30fc<\/code> (\u4e00\u822c\u7684\u306a\u30e9\u30f3\u30bf\u30a4\u30e0\u30a8\u30e9\u30fc)\u3068 <code>\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30e9\u30fc<\/code> (\u69cb\u6587\u306e\u554f\u984c\uff09\u3002\u307b\u3068\u3093\u3069\u306e\u30e6\u30fc\u30b6\u30fc\u51e6\u7406\u4f8b\u5916\u306f <code>\u6a19\u6e96\u30a8\u30e9\u30fc<\/code>, \u306e\u3088\u3046\u306a\u30b7\u30b9\u30c6\u30e0\u30ec\u30d9\u30eb\u306e\u3082\u306e\u306b\u5bfe\u3057\u3066 <code>\u30b7\u30b0\u30ca\u30eb\u4f8b\u5916<\/code> \u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u512a\u96c5\u306b\u7d42\u4e86\u3067\u304d\u308b\u3088\u3046\u306b\u3001\u901a\u5e38\u306f\u51e6\u7406\u3055\u308c\u306a\u3044\u307e\u307e\u306b\u3057\u3066\u304a\u304f\u3002.<\/p><p>\u306a\u305c\u4f8b\u5916\u3092\u51e6\u7406\u3059\u308b\u306e\u304b\uff1f\u5b8c\u74a7\u306a\u4e16\u754c\u3067\u3042\u308c\u3070\u3001\u30b3\u30fc\u30c9\u306f\u5b8c\u74a7\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u304c\u3001\u73fe\u5b9f\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3001\u5916\u90e8API\u3001\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u63a5\u7d9a\u306a\u3069\u3001\u4e88\u6e2c\u4e0d\u53ef\u80fd\u306a\u8981\u7d20\u3068\u76f8\u4e92\u4f5c\u7528\u3057\u307e\u3059\u3002\u4f8b\u5916\u304c\u51e6\u7406\u3055\u308c\u306a\u3044\u3068\u3001\u30c7\u30fc\u30bf\u306e\u640d\u5931\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u8106\u5f31\u6027\u3001\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u6df7\u4e71\u306b\u3064\u306a\u304c\u308a\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001Ruby on Rails\u3067\u69cb\u7bc9\u3055\u308c\u305fWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u30a8\u30e9\u30fc\u3092\u691c\u51fa\u3059\u308b\u3053\u3068\u3067\u3001\u30b5\u30a4\u30c8\u5168\u4f53\u306e\u30c0\u30a6\u30f3\u3092\u9632\u3050\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002.<\/p><p>\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u306a\u3044\u5358\u7d14\u306a\u4f8b\u3092\u8003\u3048\u3066\u307f\u3088\u3046\uff1a<\/p><pre>\u30eb\u30d3\u30fc\ndef divide(a, b)\n  a \/ b\n\u7d42\u4e86\nresult = divide(10, 0) # \u3053\u308c\u306fZeroDivisionError\u3092\u767a\u751f\u3055\u305b\u308b\u3002<\/pre><p>\u3053\u306e\u30b3\u30fc\u30c9\u306f\u30a8\u30e9\u30fc\u3067\u7d42\u4e86\u3059\u308b\uff1a\u300c\u3068\u3044\u3046\u30a8\u30e9\u30fc\u3067\u7d42\u4e86\u3059\u308b\u3002\u3053\u308c\u3092\u9632\u3050\u306b\u306f\u3001\u5371\u967a\u306a\u30b3\u30fc\u30c9\u3092\u51e6\u7406\u30d6\u30ed\u30c3\u30af\u3067\u56f2\u3080\u5fc5\u8981\u304c\u3042\u308b\u3002.<\/p><h3><strong>Ruby Try Catch\u3068\u306f\uff1f<\/strong><\/h3><p>Ruby\u306eTry Catch\u3068\u306f\u3001Ruby\u306b\u7d44\u307f\u8fbc\u307e\u308c\u305f\u4f8b\u5916\u51e6\u7406\u6a5f\u69cb\u306e\u3053\u3068\u3067\u3001\u958b\u767a\u8005\u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u30af\u30e9\u30c3\u30b7\u30e5\u3055\u305b\u308b\u3053\u3068\u306a\u304f\u3001\u5b9f\u884c\u6642\u306e\u30a8\u30e9\u30fc\u3092\u512a\u96c5\u306b\u51e6\u7406\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002Ruby\u3067\u306f\u30ea\u30c6\u30e9\u30eb <code>\u30c8\u30e9\u30a4\u30ad\u30e3\u30c3\u30c1<\/code> \u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u4f7f\u3063\u3066\u540c\u3058\u6a5f\u80fd\u3092\u5b9f\u73fe\u3057\u3066\u3044\u308b\u3002 <code>begin\u3001rescue\u3001else<\/code>\u3001 \u305d\u3057\u3066 <code>\u78ba\u4fdd\u3059\u308b<\/code> \u3092\u30d6\u30ed\u30c3\u30af\u3059\u308b\u3002.<\/p><p>\u3053\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u306b\u3088\u3063\u3066\u958b\u767a\u8005\u306f\u3001\u7121\u52b9\u306a\u5165\u529b\u3001\u30d5\u30a1\u30a4\u30eb\u30a2\u30af\u30bb\u30b9\u306e\u554f\u984c\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a8\u30e9\u30fc\u306a\u3069\u306e\u6f5c\u5728\u7684\u306a\u969c\u5bb3\u3092\u4e88\u6e2c\u3057\u3001\u305d\u308c\u3089\u3092\u5236\u5fa1\u3055\u308c\u305f\u65b9\u6cd5\u3067\u51e6\u7406\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u5f3e\u529b\u6027\u306e\u3042\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u305d\u306e <code>\u30ec\u30b9\u30ad\u30e5\u30fc<\/code> \u30d6\u30ed\u30c3\u30af\u306f\u4f8b\u5916\u767a\u751f\u6642\u306b\u4f8b\u5916\u3092\u6355\u6349\u3057\u307e\u3059\u3002 <code>\u305d\u308c\u4ee5\u5916<\/code> \u30d6\u30ed\u30c3\u30af\u306f\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u306a\u3044\u3068\u304d\u306b\u5b9f\u884c\u3055\u308c <code>\u78ba\u4fdd\u3059\u308b<\/code> \u30d6\u30ed\u30c3\u30af\u306f\u6210\u5426\u306b\u95a2\u4fc2\u306a\u304f\u5b9f\u884c\u3055\u308c\u308b\u306e\u3067\u3001\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u30fb\u30bf\u30b9\u30af\u306b\u6700\u9069\u3067\u3042\u308b\u3002.<\/p><h3><strong>\u57fa\u672c\u69cb\u9020\uff1a\u958b\u59cb-\u6551\u51fa-\u7d42\u4e86<\/strong><\/h3><p>Ruby\u306e\u30b3\u30a2\u4f8b\u5916\u51e6\u7406\u306f <code>\u958b\u59cb...\u30ec\u30b9\u30ad\u30e5\u30fc...\u7d42\u4e86<\/code> \u3053\u308c\u306f\u3001\u4ed6\u306e\u8a00\u8a9e\u306b\u304a\u3051\u308b \u201ctry-catch \u201d\u306b\u4f3c\u3066\u3044\u308b\u3002\u305d\u306e <code>\u59cb\u3081\u308b<\/code> \u30d6\u30ed\u30c3\u30af\u306b\u306f\u4f8b\u5916\u3092\u767a\u751f\u3055\u305b\u308b\u53ef\u80fd\u6027\u306e\u3042\u308b\u30b3\u30fc\u30c9\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3002 <code>\u30ec\u30b9\u30ad\u30e5\u30fc<\/code> \u304c\u30ad\u30e3\u30c3\u30c1\u3057\u3066\u51e6\u7406\u3059\u308b\u3002.<\/p><p>\u3053\u308c\u304c\u6700\u3082\u30b7\u30f3\u30d7\u30eb\u306a\u5f62\u3060\uff1a<\/p><pre>\u30eb\u30d3\u30fc\n\u958b\u59cb\n  # \u5931\u6557\u3059\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u30b3\u30fc\u30c9\n  \u7d50\u679c = 10 \/ 0\n\u30ec\u30b9\u30ad\u30e5\u30fc\n  # \u30a8\u30e9\u30fc\u3092\u51e6\u7406\u3059\u308b\n  puts \"\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\uff01\"\n\u7d42\u4e86<\/pre><p>\u3053\u306e\u5834\u5408\u3001\u30bc\u30ed\u306b\u3088\u308b\u9664\u7b97\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308b\u3002 <code>\u30bc\u30ed\u9664\u7b97\u30a8\u30e9\u30fc<\/code>, \u306b\u3088\u3063\u3066\u30ad\u30e3\u30c3\u30c1\u3055\u308c\u308b\u3002 <code>\u30ec\u30b9\u30ad\u30e5\u30fc<\/code>, \u30af\u30e9\u30c3\u30b7\u30e5\u3059\u308b\u4ee3\u308f\u308a\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u3002\u30d7\u30ed\u30b0\u30e9\u30e0\u306f <code>\u7d42\u308f\u308a<\/code>.<\/p><p>\u3053\u306e\u57fa\u672c\u7684\u306a\u30ec\u30b9\u30ad\u30e5\u30fc\u306f <em>\u3059\u3079\u3066<\/em> \u304b\u3089\u6d3e\u751f\u3057\u305f\u4f8b\u5916 <code>\u6a19\u6e96\u30a8\u30e9\u30fc<\/code>. .\u3057\u304b\u3057\u3001\u4f55\u3067\u3082\u304b\u3093\u3067\u3082\u7121\u5dee\u5225\u306b\u30ad\u30e3\u30c3\u30c1\u3059\u308b\u306e\u306f\u3001\u5f80\u3005\u306b\u3057\u3066\u826f\u304f\u306a\u3044\u3084\u308a\u65b9\u3060\u3002\u305d\u306e\u4ee3\u308f\u308a\u306b\u3001\u4f8b\u5916\u306e\u7a2e\u985e\u3092\u6307\u5b9a\u3059\u308b\uff1a<\/p><pre>\u30eb\u30d3\u30fc\n\u958b\u59cb\n  \u7d50\u679c = 10 \/ 0\nrescue \u30bc\u30ed\u9664\u7b97\u30a8\u30e9\u30fc\n  puts \"\u30bc\u30ed\u3067\u5272\u308a\u5207\u308c\u307e\u305b\u3093!\"\n\u7d42\u4e86<\/pre><p>\u4eca\u306f <code>\u30bc\u30ed\u9664\u7b97\u30a8\u30e9\u30fc<\/code> \u305d\u306e\u4ed6\u306e\u4f8b\u5916\u306f\u30b3\u30fc\u30eb\u30b9\u30bf\u30c3\u30af\u3092\u4f1d\u642c\u3059\u308b\u3002.<\/p><p>\u4f8b\u5916\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30ad\u30e3\u30d7\u30c1\u30e3\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u8a73\u7d30\u306a\u60c5\u5831\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 <code>=&gt;<\/code>:<\/p><pre>\u30eb\u30d3\u30fc\n\u958b\u59cb\n  File.open(\"nonexistent.txt\")\nrescue Errno::ENOENT =&gt; e\n  puts \"\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093: #{e.message}\"\nend<\/pre><p>\u3053\u3053\u3001 <code>e<\/code> \u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u63d0\u4f9b\u3059\u308b\u4f8b\u5916\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3042\u308b\u3002 <code>\u30e1\u30c3\u30bb\u30fc\u30b8\u3001\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9<\/code>, \u306a\u3069\u306e\u5c5e\u6027\u304c\u3042\u308b\u3002\u3053\u308c\u306f\u3001\u30ed\u30ae\u30f3\u30b0\u3084\u30c7\u30d0\u30c3\u30b0\u306e\u969b\u306b\u975e\u5e38\u306b\u8cb4\u91cd\u3067\u3042\u308b\u3002.<\/p><p>\u8907\u6570\u306e\u30ec\u30b9\u30ad\u30e5\u30fc\u304c\u7570\u306a\u308b\u4f8b\u5916\u3092\u51e6\u7406\u3067\u304d\u308b\uff1a<\/p><pre>\u30eb\u30d3\u30fc\n\u958b\u59cb\n  # \u3044\u304f\u3064\u304b\u306e\u30b3\u30fc\u30c9\nrescue ZeroDivisionError =&gt; e\n  puts \"\u9664\u7b97\u30a8\u30e9\u30fc\uff1a#{e}\"\nrescue \u5f15\u6570\u30a8\u30e9\u30fc =&gt; e\n  puts \"\u7121\u52b9\u306a\u5f15\u6570\u3067\u3059\uff1a#{e}\"\n\u7d42\u4e86<\/pre><p>Ruby\u306f\u30ec\u30b9\u30ad\u30e5\u30fc\u3092\u9806\u756a\u306b\u8a55\u4fa1\u3059\u308b\u306e\u3067\u3001\u7279\u5b9a\u306e\u30ec\u30b9\u30ad\u30e5\u30fc\u3092\u4e00\u822c\u7684\u306a\u30ec\u30b9\u30ad\u30e5\u30fc\u306e\u524d\u306b\u7f6e\u304f\u3002.<\/p><h3><strong>Else\u53e5\uff1a\u4f8b\u5916\u304c\u767a\u751f\u3057\u306a\u3044\u5834\u5408<\/strong><\/h3><p>\u306b\u3064\u3044\u3066 <code>\u305d\u308c\u4ee5\u5916<\/code> \u3067\u4f8b\u5916\u304c\u767a\u751f\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u306b\u306e\u307f\u5b9f\u884c\u3055\u308c\u308b\u3002 <code>\u59cb\u3081\u308b<\/code> \u30d6\u30ed\u30c3\u30af\u306f\u3001\u30e1\u30a4\u30f3\u30ed\u30b8\u30c3\u30af\u3068\u6df7\u5728\u3055\u305b\u305a\u306b\u6210\u529f\u6642\u306b\u5b9f\u884c\u3055\u308c\u308b\u3079\u304d\u30b3\u30fc\u30c9\u306b\u4fbf\u5229\u3067\u3059\u3002.<\/p><pre>\u30eb\u30d3\u30fc\n\u958b\u59cb\n  \u7d50\u679c = 10 \/ 2\nrescue \u30bc\u30ed\u9664\u7b97\u30a8\u30e9\u30fc\n  \"\u30a8\u30e9\u30fc\uff01\"\u3092\u30d7\u30c3\u30c8\u3059\u308b\nelse\n  puts \"\u6210\u529f\uff1a#{result}\"\n\u7d42\u4e86<\/pre><p>\u51fa\u529b\uff1a\u300c\u6210\u529f\uff1a5\u201c.\u4f8b\u5916\u304c\u767a\u751f\u3057\u305f\u5834\u5408, <code>\u305d\u308c\u4ee5\u5916<\/code> \u306f\u30b9\u30ad\u30c3\u30d7\u3055\u308c\u3001\u5236\u5fa1\u306f <code>\u30ec\u30b9\u30ad\u30e5\u30fc<\/code>.<\/p><p>\u3053\u308c\u306f\u3001\u6210\u529f\u30d1\u30b9\u3068\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u5206\u96e2\u3057\u3001\u5165\u308c\u5b50\u3092\u6e1b\u3089\u3057\u3001\u8907\u96d1\u306a\u30e1\u30bd\u30c3\u30c9\u306e\u53ef\u8aad\u6027\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u30af\u30ea\u30fc\u30f3\u306a\u30b3\u30fc\u30c9\u3092\u4fc3\u9032\u3059\u308b\u3002.<\/p><h3><strong>\u30a8\u30f3\u30b7\u30e5\u30a2\u6761\u9805\uff1a\u5e38\u306b\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u3092\u5b9f\u884c\u3059\u308b<\/strong><\/h3><p>\u306b\u3064\u3044\u3066 <code>\u78ba\u4fdd\u3059\u308b<\/code> \u53e5\u306f\u3001\u4f8b\u5916\u304c\u767a\u751f\u3057\u305f\u304b\u30ad\u30e3\u30c3\u30c1\u3055\u308c\u305f\u304b\u306b\u95a2\u4fc2\u306a\u304f\u5b9f\u884c\u3055\u308c\u308b\u306e\u3067\u3001\u30d5\u30a1\u30a4\u30eb\u3084\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u3092\u9589\u3058\u308b\u3088\u3046\u306a\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u30fb\u30bf\u30b9\u30af\u306b\u6700\u9069\u3067\u3042\u308b\u3002.<\/p><pre>\u30eb\u30d3\u30fc\n\u30d5\u30a1\u30a4\u30eb = nil\n\u958b\u59cb\n  file = File.open(\"data.txt\", \"r\")\n  # \u30d5\u30a1\u30a4\u30eb\u3092\u51e6\u7406\u3059\u308b\nrescue Errno::ENOENT\n  puts \"\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\"\n\u78ba\u5b9f\n  file.close if file\n\u7d42\u4e86<\/pre><p>\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u3067\u3042\u3063\u3066\u3082\uff08\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u306f <code>Errno::ENOENT<\/code>)\u3001\u307e\u305f\u306f\u51e6\u7406\u304c\u6210\u529f\u3057\u305f\u5834\u5408\u3001, <code>\u78ba\u4fdd\u3059\u308b<\/code> \u304c\u30aa\u30fc\u30d7\u30f3\u3055\u308c\u305f\u5834\u5408\u3001\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30af\u30ed\u30fc\u30ba\u3059\u308b\u3002\u3053\u308c\u306f\u3001I\/O\u3092\u591a\u7528\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u3088\u304f\u3042\u308b\u554f\u984c\u3067\u3042\u308b\u30ea\u30bd\u30fc\u30b9\u30fb\u30ea\u30fc\u30af\u3092\u9632\u3050\u3002.<\/p><p><code>\u78ba\u4fdd\u3059\u308b<\/code> \u306e\u5f8c\u306b\u5b9f\u884c\u3055\u308c\u308b\u3002 <code>\u30ec\u30b9\u30ad\u30e5\u30fc<\/code> \u307e\u305f\u306f <code>\u305d\u308c\u4ee5\u5916<\/code>, \u3067\u4f8b\u5916\u304c\u767a\u751f\u3057\u305f\u5834\u5408 <code>\u6551\u51fa\u3001\u78ba\u4fdd<\/code> \u306f\u30ea\u30ec\u30a4\u30ba\u3059\u308b\u524d\u306b\u307e\u3060\u5b9f\u884c\u3059\u308b\u3002.<\/p><h3><strong>\u624b\u52d5\u3067\u4f8b\u5916\u3092\u767a\u751f\u3055\u305b\u308b<\/strong><\/h3><p>\u6642\u306b\u306f <code>\u30ec\u30a4\u30ba<\/code> (\u307e\u305f\u306f <code>\u5931\u6557<\/code>, \u305d\u306e\u5225\u540d\uff09\u3002.<\/p><pre>\u30eb\u30d3\u30fc\ndef check_age(age)\n  raise ArgumentError, \"\u5e74\u9f62\u306f\u6b63\u3067\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\" if age &lt; 0\n  # \u9032\u3080\n\u7d42\u4e86<\/pre><p>\u3053\u306e\u305f\u3081 <code>\u5f15\u6570\u30a8\u30e9\u30fc<\/code> \u3092\u30ab\u30b9\u30bf\u30e0\u30fb\u30e1\u30c3\u30bb\u30fc\u30b8\u3067\u8fd4\u3059\u3002\u30ec\u30b9\u30ad\u30e5\u30fc\u30fb\u30d6\u30ed\u30c3\u30af\u306e\u4e2d\u3067\u73fe\u5728\u306e\u4f8b\u5916\u3092\u518d\u3073\u767a\u751f\u3055\u305b\u308b\u305f\u3081\u306b\u3001\u5f15\u6570\u306a\u3057\u3067 raise \u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u3002.<\/p><p>\u3082\u3063\u3068\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3057\u305f\u3044\uff1a<\/p><pre>\u30eb\u30d3\u30fc\nraise MyCustomError.new(\"\u8a73\u7d30\")<\/pre><p>\u30ab\u30b9\u30bf\u30e0\u4f8b\u5916\u306b\u3064\u3044\u3066\u306f\u5f8c\u3067\u8aac\u660e\u3059\u308b\u3002.<\/p><p>\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u3001\u30ad\u30e3\u30c3\u30c1\u3055\u308c\u308b\u304b\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u7d42\u4e86\u3059\u308b\u307e\u3067\u3001\u672a\u51e6\u7406\u306e\u4f8b\u5916\u306f\u30b3\u30fc\u30eb\u30b9\u30bf\u30c3\u30af\u306b\u30d0\u30d6\u30eb\u30a2\u30c3\u30d7\u3055\u308c\u308b\u3002\u3053\u308c\u306f\u3001Rails\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30ec\u30d9\u30eb\u3067\u306eAPI\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u3088\u3046\u306b\u3001\u968e\u5c64\u5316\u3055\u308c\u305f\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3067\u6709\u7528\u3067\u3059\u3002.<\/p><h3><strong>\u518d\u6311\u6226\u518d\u6311\u6226<\/strong><\/h3><p>\u30eb\u30d3\u30fc <code>\u30ea\u30c8\u30e9\u30a4<\/code> \u30ad\u30fc\u30ef\u30fc\u30c9\u3002 <code>\u30ec\u30b9\u30ad\u30e5\u30fc<\/code>, \u3092\u518d\u8d77\u52d5\u3059\u308b\u3002 <code>\u59cb\u3081\u308b<\/code> \u30d6\u30ed\u30c3\u30af\u306f\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u306e\u3088\u3046\u306a\u4e00\u6642\u7684\u306a\u30a8\u30e9\u30fc\u306b\u4fbf\u5229\u3067\u3059\u3002.<\/p><pre>\u30eb\u30d3\u30fc\n\u8a66\u884c\u56de\u6570 = 0\n\u958b\u59cb\n  \u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3059\u308b\nrescue \u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u30a8\u30e9\u30fc\n  \u8a66\u884c\u56de\u6570 += 1\n  \u30ea\u30c8\u30e9\u30a4 if attempts &lt; 3\n  puts &quot;3\u56de\u8a66\u884c\u3057\u3066\u5931\u6557&quot;\n\u7d42\u4e86<\/pre><p>\u3053\u308c\u306f3\u56de\u307e\u3067\u30ea\u30c8\u30e9\u30a4\u3067\u304d\u308b\u3002\u5236\u9650\u306a\u3057\u3067\u306f\u7121\u9650\u306b\u30eb\u30fc\u30d7\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u3002\u3079\u304d\u7b49\u64cd\u4f5c\u306b\u306e\u307f\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002.<\/p><h3><strong>\u4f8b\u5916\u306e\u968e\u5c64\u3068\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/strong><\/h3><p>Ruby\u306e\u4f8b\u5916\u30af\u30e9\u30b9\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u3059\u3079\u3066 <code>\u4f8b\u5916<\/code>, \u3057\u304b\u3057\u3001\u30af\u30e9\u30b9\u306a\u3057\u306e\u30ec\u30b9\u30ad\u30e5\u30fc\u304c\u30ad\u30e3\u30c3\u30c1\u3059\u308b\u306e\u306f <code>\u6a19\u6e96\u30a8\u30e9\u30fc<\/code> \u3068\u30b5\u30d6\u30af\u30e9\u30b9\u3002\u3059\u3079\u3066\u3092\u30ad\u30e3\u30c3\u30c1\u3059\u308b\uff08\u307b\u3068\u3093\u3069\u63a8\u5968\u3055\u308c\u306a\u3044\uff09\uff1a<\/p><p>\u3053\u308c\u306b\u306f\u4ee5\u4e0b\u304c\u542b\u307e\u308c\u308b\u3002 <code>\u30b7\u30b9\u30c6\u30e0\u7d42\u4e86\u3001NoMemoryError<\/code>, \u306a\u3069\u3001\u6271\u3044\u305f\u304f\u306a\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u3002.<\/p><p>\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\uff1a\u30d0\u30b0\u3092\u98f2\u307f\u8fbc\u307e\u306a\u3044\u3088\u3046\u306b\u3001\u7279\u5b9a\u306e\u4f8b\u5916\u3092\u30ec\u30b9\u30ad\u30e5\u30fc\u3059\u308b\u3002\u4f8b\u3048\u3070\u3001\u30a6\u30a7\u30d6\u30b9\u30af\u30ec\u30fc\u30d1\u30fc\u306e\u5834\u5408\uff1a<\/p><pre>\u30eb\u30d3\u30fc\nnet\/http' \u3092\u5fc5\u8981\u3068\u3059\u308b\u3002\n\n\u958b\u59cb\n  response = Net::HTTP.get(URI('https:\/\/example.com\"))\nrescue SocketError, Timeout::Error =&gt; e\n  puts \"\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a8\u30e9\u30fc\u3067\u3059\uff1a#{e}\"\nrescue =&gt; e # Catch other StandardErrors\n  puts \"\u4e88\u671f\u3057\u306a\u3044\u30a8\u30e9\u30fc: #{e}\"\n\u7d42\u4e86<\/pre><p>Ruby\u306e <code>\u30ed\u30ac\u30fc<\/code> \u307e\u305f\u306fSentry\u306e\u3088\u3046\u306a\u751f\u7523\u76e3\u8996\u7528\u306e\u30b8\u30a7\u30e0\u3002.<\/p><p>\u81f4\u547d\u7684\u306a\u30a8\u30e9\u30fc\u306f\u30c7\u30d0\u30c3\u30b0\u306e\u305f\u3081\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u3055\u305b\u308b\u3002\u30c6\u30b9\u30c8\u3067\u306f <code>\u30a2\u30b5\u30fc\u30c8<\/code> \u304b\u3089\u4f8b\u5916\u3092\u691c\u8a3c\u3059\u308b\u3002.<\/p><h3><strong>\u30ab\u30b9\u30bf\u30e0\u4f8b\u5916\uff1a\u30a8\u30e9\u30fc\u306e\u8abf\u6574<\/strong><\/h3><p>\u30c9\u30e1\u30a4\u30f3\u56fa\u6709\u306e\u30a8\u30e9\u30fc\u306b\u3064\u3044\u3066\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u30b5\u30d6\u30af\u30e9\u30b9\u5316\u3057\u3066\u30ab\u30b9\u30bf\u30e0\u4f8b\u5916\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 <code>\u6a19\u6e96\u30a8\u30e9\u30fc<\/code>:<\/p><pre>\u30eb\u30d3\u30fc\n\u30af\u30e9\u30b9 InvalidUserError &lt; StandardError\n  attr_reader :user_id\n\n  def initialize(user_id, msg = &quot;Invalid user&quot;)\n    user_id = user_id\n    super(msg)\n  \u7d42\u4e86\n\u7d42\u4e86\n\ndef fetch_user(id)\n  raise InvalidUserError.new(id) if id.nil?\n  #\u30d5\u30a7\u30c3\u30c1\u30ed\u30b8\u30c3\u30af\n\u7d42\u4e86<\/pre><p>\u3053\u308c\u306b\u3088\u308a\u3001\u6b63\u78ba\u306a\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u304c\u53ef\u80fd\u306b\u306a\u308b\uff1a<\/p><pre>\u30eb\u30d3\u30fc\n\u958b\u59cb\n  fetch_user(nil)\nrescue InvalidUserError =&gt; e\n  puts \"\u30e6\u30fc\u30b6#{e.user_id}\u304c\u7121\u52b9\u3067\u3059\uff1a#{e.message}\"\nend<\/pre><p>\u30ab\u30b9\u30bf\u30e0\u4f8b\u5916\u306f\u30b3\u30fc\u30c9\u306e\u8868\u73fe\u529b\u3092\u9ad8\u3081\u3001\u4ed6\u306e\u958b\u767a\u8005\uff08\u3042\u308b\u3044\u306f\u5c06\u6765\u306e\u3042\u306a\u305f\uff09\u304c\u969c\u5bb3\u30e2\u30fc\u30c9\u3092\u7406\u89e3\u3057\u3084\u3059\u304f\u3057\u307e\u3059\u3002.<\/p><h3><strong>\u9ad8\u5ea6\u306a\u30c8\u30d4\u30c3\u30af\u30cd\u30b9\u30c8\u3055\u308c\u305f\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3068\u30b0\u30ed\u30fc\u30d0\u30eb\u30fb\u30ec\u30b9\u30ad\u30e5\u30fc<\/strong><\/h3><p>\u4f8b\u5916\u306f\u5165\u308c\u5b50\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\uff1a<\/p><pre>\u30eb\u30d3\u30fc\n\u59cb\u3081\u308b\n  \u958b\u59cb\n    raise \"\u5185\u90e8\u30a8\u30e9\u30fc\"\n  \u30ec\u30b9\u30ad\u30e5\u30fc\n    raise \"\u5916\u5074\u306e\u30a8\u30e9\u30fc\"\n  end\nrescue =&gt; e\n  puts e.message # \"\u5916\u5074\u306e\u30a8\u30e9\u30fc\"\nend<\/pre><p>\u5185\u5074\u306e\u30ec\u30b9\u30ad\u30e5\u30fc\u304c\u30ea\u30ec\u30a4\u30ba\u3057\u3001\u5916\u5074\u306e\u30ec\u30b9\u30ad\u30e5\u30fc\u304c\u30ad\u30e3\u30c3\u30c1\u3002.<\/p><p>\u30b0\u30ed\u30fc\u30d0\u30eb\u306a\u51e6\u7406\u306b\u306f <code>at_exit<\/code> \u307e\u305f\u306fRails\u306e\u2019 <code>\u30ec\u30b9\u30ad\u30e5\u30fc\u30d5\u30ed\u30e0<\/code> \u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3067\u4f7f\u7528\u3057\u307e\u3059\u3002\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u306f\u3001\u30e1\u30a4\u30f3\u30ed\u30b8\u30c3\u30af\u3092\u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u306ebegin-rescue\u3067\u56f2\u307f\u307e\u3059\u3002.<\/p><p>Ruby 2.5\u4ee5\u4e0a\u3092\u5c0e\u5165 <code>\u30ec\u30b9\u30ad\u30e5\u30fc<\/code> \u306e\u306a\u3044\u30d6\u30ed\u30c3\u30af\u3067 <code>\u59cb\u3081\u308b<\/code>:<\/p><pre>\u30eb\u30d3\u30fc\ndef \u30e1\u30bd\u30c3\u30c9\n  risky_operation\nrescue SomeError =&gt; e\n  \u30cf\u30f3\u30c9\u30eb(e)\n\u7d42\u4e86<\/pre><p>\u3053\u308c\u306f\u5358\u7d14\u306a\u65b9\u6cd5\u3092\u5358\u7d14\u5316\u3059\u308b\u3002.<\/p><h3><strong>\u3088\u304f\u3042\u308b\u843d\u3068\u3057\u7a74\u3068\u30c7\u30d0\u30c3\u30b0<\/strong><\/h3><p>\u3088\u304f\u3042\u308b\u9593\u9055\u3044\u306f\u3001\u30d0\u30b0\u3092\u96a0\u3057\u3066\u5927\u96d1\u628a\u306b\u6551\u51fa\u3059\u308b\u3053\u3068\u3060\u3002\u4f8b\u3048\u3070 <code>\u4f8b\u5916<\/code> \u91e3\u308c\u308b\u304b\u3082\u3057\u308c\u306a\u3044 <code>\u69cb\u6587\u30a8\u30e9\u30fc<\/code> \u958b\u767a\u4e2d\u306b\u554f\u984c\u3092\u96a0\u853d.<\/p><p><strong>\u3082\u3046\u3072\u3068\u3064\uff1a<\/strong> \u5fd8\u5374 <code>\u78ba\u4fdd\u3059\u308b<\/code> \u306e\u3088\u3046\u306a\u30d6\u30ed\u30c3\u30af\u3092\u4f7f\u7528\u3059\u308b\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d6\u30ed\u30c3\u30af\u3092\u4f7f\u7528\u3059\u308b\u3002 <code>\u30d5\u30a1\u30a4\u30eb.\u30aa\u30fc\u30d7\u30f3<\/code> \u3092\u30d6\u30ed\u30c3\u30af\u5f15\u6570\u3067\u6307\u5b9a\u3059\u308b\u3002.<\/p><p><strong>\u30c7\u30d0\u30c3\u30b0\uff1a<\/strong> \u7528\u9014 <code>$!<\/code> (\u30b0\u30ed\u30fc\u30d0\u30eb\u6700\u5f8c\u306e\u4f8b\u5916\uff09\u307e\u305f\u306f <code>\u547c\u3073\u51fa\u3057\u5074<\/code> \u3092\u30b9\u30bf\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u306b\u4f7f\u7528\u3059\u308b\u3002Pry\u3084byebug\u306e\u3088\u3046\u306a\u30c4\u30fc\u30eb\u306f\u3001\u4f8b\u5916\u3092\u5bfe\u8a71\u7684\u306b\u691c\u67fb\u3059\u308b\u306e\u306b\u5f79\u7acb\u3064\u3002.<\/p><p><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9<\/strong> \u4f8b\u5916\u51e6\u7406\u306f\u6761\u4ef6\u5f0f\u3088\u308a\u3082\u9045\u3044\u306e\u3067\u3001\u983b\u7e41\u306b\u30c1\u30a7\u30c3\u30af\u3059\u308b\u5834\u5408\uff08\u5165\u529b\u306e\u691c\u8a3c\u306a\u3069\uff09\u306f\u3001raising\u306e\u4ee3\u308f\u308a\u306bif\u6587\u3092\u4f7f\u3046\u3002.<\/p><h3><strong>\u5b9f\u4e16\u754c\u3067\u306e\u5fdc\u7528<\/strong><\/h3><p>Sinatra\u3084Rails\u3092\u4f7f\u3063\u305fWeb\u958b\u767a\u3067\u306f\u3001\u4f8b\u5916\u51e6\u7406\u306b\u3088\u3063\u3066500\u30a8\u30e9\u30fc\u3092\u9632\u3050\u3053\u3068\u304c\u3067\u304d\u308b\u3002Rails\u306e\u2019 <code>\u30ec\u30b9\u30ad\u30e5\u30fc\u30d5\u30ed\u30e0<\/code> \u306f\u30a2\u30d7\u30ea\u5168\u4f53\u3067\u30ad\u30e3\u30c3\u30c1\u3059\u308b\uff1a<\/p><pre>\u30eb\u30d3\u30fc\n\u30af\u30e9\u30b9 ApplicationController &lt; ActionController::Base\n  rescue_from ActiveRecord::RecordNotFound, with: :not_found\n\n  def not_found\n    \u30d5\u30a1\u30a4\u30eb\u3092\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b&#039;public\/404.html&#039;, status: :not_found\n  \u7d42\u4e86\n\u7d42\u4e86<\/pre><p>\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3001\u30d5\u30a1\u30a4\u30ebI\/O\u30a8\u30e9\u30fc\u3092\u51e6\u7406\u3057\u3001\u518d\u8a66\u884c\u307e\u305f\u306f\u30ed\u30b0\u306b\u8a18\u9332\u3059\u308b\u3002.<\/p><p>API\u306e\u5834\u5408\u306f\u3001\u5916\u90e8\u547c\u3073\u51fa\u3057\u3092\u30e9\u30c3\u30d7\u3059\u308b\uff1a<\/p><pre>\u30eb\u30d3\u30fc\nrequire 'json'\nrequire 'net\/http'\n\ndef fetch_api(url)\n  uri = URI(url)\n  response = Net::HTTP.get(uri)\n  JSON.parse(response)\nrescue JSON::ParserError\n  { error\uff1a\"\u7121\u52b9\u306aJSON\"}\nrescue Net::ReadTimeout\n  {\u30a8\u30e9\u30fc\uff1a\u300c\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\uff5d\n\u7d42\u4e86<\/pre><p>\u3053\u308c\u306b\u3088\u308a\u3001\u512a\u96c5\u306a\u52a3\u5316\u304c\u4fdd\u8a3c\u3055\u308c\u308b\u3002.<\/p><p>\u30b9\u30ec\u30c3\u30c9\u3092\u4f7f\u3063\u305f\u4e26\u884c\u30b3\u30fc\u30c9\u3067\u306f\u30011\u3064\u306e\u30b9\u30ec\u30c3\u30c9\u3067\u767a\u751f\u3057\u305f\u4f8b\u5916\u306f\u3001\u7d50\u5408\u3057\u306a\u3044\u9650\u308a\u4ed6\u306e\u30b9\u30ec\u30c3\u30c9\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u306a\u3044\u3002\u4f7f\u7528\u65b9\u6cd5 <code>\u30b9\u30ec\u30c3\u30c9#report_on_exception<\/code> \u3092Ruby 2.4+\u3067\u30ed\u30ae\u30f3\u30b0\u3059\u308b\u3002.<\/p><h2><strong>\u304a\u308f\u308a\u306bRuby\u306e\u4f8b\u5916\u51e6\u7406\u3092\u30de\u30b9\u30bf\u30fc\u3059\u308b<\/strong><\/h2><p>Ruby\u3067\u306e\u4f8b\u5916\u51e6\u7406 <code>\u30d3\u30ae\u30f3\u30fb\u30ec\u30b9\u30ad\u30e5\u30fc\u30fb\u30a8\u30eb\u30b9\u30fb\u30a8\u30f3\u30b7\u30e5\u30a2<\/code>, \u3053\u306e\u3088\u3046\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u30d5\u30a9\u30fc\u30eb\u30c8\u30fb\u30c8\u30ec\u30e9\u30f3\u30c8\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u306e\u3001\u5f37\u529b\u3067\u67d4\u8edf\u306a\u65b9\u6cd5\u3092\u63d0\u4f9b\u3059\u308b\u3002\u69cb\u6587\u3001\u968e\u5c64\u3001\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u3067\u3001\u6a5f\u80fd\u7684\u3067\u3042\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u5b9f\u4e16\u754c\u306e\u5b9f\u884c\u306e\u6df7\u4e71\u306b\u5f37\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u3002.<\/p><p>\u5177\u4f53\u7684\u306a\u6551\u52a9\u6d3b\u52d5\u304b\u3089\u59cb\u3081\u3001\u6b21\u306e\u3088\u3046\u306b\u4f7f\u7528\u3059\u308b\u3002 <code>\u78ba\u4fdd\u3059\u308b<\/code> \u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u306e\u305f\u3081\u306b\u30ab\u30b9\u30bf\u30e0\u4f8b\u5916\u3092\u767a\u751f\u3055\u305b\u3001\u660e\u78ba\u306b\u3059\u308b\u3002\u904e\u5270\u30ec\u30b9\u30ad\u30e5\u30fc\u306e\u3088\u3046\u306a\u3088\u304f\u3042\u308b\u843d\u3068\u3057\u7a74\u3092\u907f\u3051\u3001\u6b21\u306e\u3088\u3046\u306a\u9ad8\u5ea6\u306a\u6a5f\u80fd\u3092\u6d3b\u7528\u3059\u308b\u3002 <code>\u30ea\u30c8\u30e9\u30a4<\/code> \u614e\u91cd\u306b\u3002.<\/p><p>\u8981\u7d04\u3059\u308b\u3068\u3001\u52b9\u679c\u7684\u306a\u4f8b\u5916\u51e6\u7406\u306f\u3001\u6f5c\u5728\u7684\u306a\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u3001\u30ea\u30ab\u30d0\u30ea\u3001\u30ed\u30ae\u30f3\u30b0\u3001\u3042\u308b\u3044\u306f\u30e6\u30fc\u30b6\u30fc\u30d5\u30ec\u30f3\u30c9\u30ea\u30fc\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u6a5f\u4f1a\u306b\u5909\u3048\u307e\u3059\u3002\u5358\u7d14\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3042\u308c\u3001\u8907\u96d1\u306aWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u3042\u308c\u3001\u3053\u306e\u6982\u5ff5\u3092\u30de\u30b9\u30bf\u30fc\u3059\u308b\u3053\u3068\u306f\u3001\u3042\u306a\u305f\u306eRuby\u306e\u5c02\u9580\u77e5\u8b58\u3092\u5f37\u5316\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002At <a href=\"https:\/\/www.railscarma.com\/ja\"><strong>\u30ec\u30fc\u30eb\u30ab\u30fc\u30de<\/strong><\/a>, \u79c1\u305f\u3061\u306f\u3001\u958b\u767a\u8005\u304c\u5b9f\u4f8b\u3092\u7528\u3044\u3066\u7df4\u7fd2\u3057\u3001IRB\u3067\u5b9f\u9a13\u3057\u3001\u81ea\u4fe1\u3092\u6301\u3063\u3066\u6b63\u78ba\u306b\u30a8\u30e9\u30fc\u3092\u51e6\u7406\u3059\u308b\u3053\u3068\u3092\u5968\u52b1\u3057\u3066\u3044\u307e\u3059\u3002.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t  <div class=\"related-post slider\">\r\n        <div class=\"headline\">\u95a2\u9023\u8a18\u4e8b<\/div>\r\n    <div class=\"post-list owl-carousel\">\r\n\r\n            <div class=\"item\">\r\n            <div class=\"thumb post_thumb\">\r\n    <a  title=\"\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u4f01\u696d\u304cRuby on Rails\u3092\u6d3b\u7528\u3057\u3066AI\u88fd\u54c1\u3092\u3088\u308a\u8fc5\u901f\u306b\u958b\u767a\u3059\u308b\u65b9\u6cd5\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/how-startups-can-build-ai-products-faster-with-ruby-on-rails\/?related_post_from=41464\">\r\n\r\n      <img decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/08\/How-Startups-Can-Build-AI-Products-Faster-with-Ruby-on-Rails.png\" class=\"attachment-full size-full wp-post-image\" alt=\"\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u4f01\u696d\u304cRuby on Rails\u3092\u6d3b\u7528\u3057\u3066AI\u88fd\u54c1\u3092\u3088\u308a\u8fc5\u901f\u306b\u958b\u767a\u3059\u308b\u65b9\u6cd5\" srcset=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/08\/How-Startups-Can-Build-AI-Products-Faster-with-Ruby-on-Rails.png 800w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/08\/How-Startups-Can-Build-AI-Products-Faster-with-Ruby-on-Rails-300x113.png 300w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/08\/How-Startups-Can-Build-AI-Products-Faster-with-Ruby-on-Rails-768x288.png 768w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/08\/How-Startups-Can-Build-AI-Products-Faster-with-Ruby-on-Rails-18x7.png 18w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\r\n\r\n    <\/a>\r\n  <\/div>\r\n\r\n  <a class=\"title post_title\"  title=\"\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u4f01\u696d\u304cRuby on Rails\u3092\u6d3b\u7528\u3057\u3066AI\u88fd\u54c1\u3092\u3088\u308a\u8fc5\u901f\u306b\u958b\u767a\u3059\u308b\u65b9\u6cd5\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/how-startups-can-build-ai-products-faster-with-ruby-on-rails\/?related_post_from=41464\">\r\n        \u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u4f01\u696d\u304cRuby on Rails\u3092\u6d3b\u7528\u3057\u3066AI\u88fd\u54c1\u3092\u3088\u308a\u8fc5\u901f\u306b\u958b\u767a\u3059\u308b\u65b9\u6cd5  <\/a>\r\n\r\n        <\/div>\r\n              <div class=\"item\">\r\n            <div class=\"thumb post_thumb\">\r\n    <a  title=\"\u30a8\u30f3\u30bf\u30fc\u30d7\u30e9\u30a4\u30ba\u5411\u3051\u81ea\u52d5\u5316\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u306b\u304a\u3051\u308bRuby on Rails\uff1a\u73fe\u4ee3\u306e\u30d3\u30b8\u30cd\u30b9\u696d\u52d9\u306e\u5909\u9769\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/%e3%82%a8%e3%83%b3%e3%82%bf%e3%83%bc%e3%83%97%e3%83%a9%e3%82%a4%e3%82%ba%e5%90%91%e3%81%91%e8%87%aa%e5%8b%95%e5%8c%96%e3%82%bd%e3%83%aa%e3%83%a5%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%ae%e3%81%9f\/?related_post_from=41410\">\r\n\r\n      <img decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/07\/Ruby-on-Rails-for-Enterprise-Automation-Solutions.png\" class=\"attachment-full size-full wp-post-image\" alt=\"\u30a8\u30f3\u30bf\u30fc\u30d7\u30e9\u30a4\u30ba\u5411\u3051\u81ea\u52d5\u5316\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u306e\u305f\u3081\u306eRuby on Rails\" srcset=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/07\/Ruby-on-Rails-for-Enterprise-Automation-Solutions.png 800w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/07\/Ruby-on-Rails-for-Enterprise-Automation-Solutions-300x113.png 300w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/07\/Ruby-on-Rails-for-Enterprise-Automation-Solutions-768x288.png 768w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/07\/Ruby-on-Rails-for-Enterprise-Automation-Solutions-18x7.png 18w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\r\n\r\n    <\/a>\r\n  <\/div>\r\n\r\n  <a class=\"title post_title\"  title=\"\u30a8\u30f3\u30bf\u30fc\u30d7\u30e9\u30a4\u30ba\u5411\u3051\u81ea\u52d5\u5316\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u306b\u304a\u3051\u308bRuby on Rails\uff1a\u73fe\u4ee3\u306e\u30d3\u30b8\u30cd\u30b9\u696d\u52d9\u306e\u5909\u9769\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/%e3%82%a8%e3%83%b3%e3%82%bf%e3%83%bc%e3%83%97%e3%83%a9%e3%82%a4%e3%82%ba%e5%90%91%e3%81%91%e8%87%aa%e5%8b%95%e5%8c%96%e3%82%bd%e3%83%aa%e3%83%a5%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%ae%e3%81%9f\/?related_post_from=41410\">\r\n        \u30a8\u30f3\u30bf\u30fc\u30d7\u30e9\u30a4\u30ba\u5411\u3051\u81ea\u52d5\u5316\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u306b\u304a\u3051\u308bRuby on Rails\uff1a\u73fe\u4ee3\u306e\u30d3\u30b8\u30cd\u30b9\u696d\u52d9\u306e\u5909\u9769  <\/a>\r\n\r\n        <\/div>\r\n              <div class=\"item\">\r\n            <div class=\"thumb post_thumb\">\r\n    <a  title=\"Ruby on Rails \u306b\u3088\u308b\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306e\u81ea\u52d5\u5316\uff1a\u5b9f\u8df5\u30ac\u30a4\u30c9\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/workflow-automation-with-ruby-on-rails-a-practical-guide\/?related_post_from=41404\">\r\n\r\n      <img decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/07\/Workflow-Automation-with-Ruby-on-Rails.png\" class=\"attachment-full size-full wp-post-image\" alt=\"Ruby on Rails \u306b\u3088\u308b\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306e\u81ea\u52d5\u5316\" srcset=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/07\/Workflow-Automation-with-Ruby-on-Rails.png 800w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/07\/Workflow-Automation-with-Ruby-on-Rails-300x113.png 300w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/07\/Workflow-Automation-with-Ruby-on-Rails-768x288.png 768w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/07\/Workflow-Automation-with-Ruby-on-Rails-18x7.png 18w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\r\n\r\n    <\/a>\r\n  <\/div>\r\n\r\n  <a class=\"title post_title\"  title=\"Ruby on Rails \u306b\u3088\u308b\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306e\u81ea\u52d5\u5316\uff1a\u5b9f\u8df5\u30ac\u30a4\u30c9\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/workflow-automation-with-ruby-on-rails-a-practical-guide\/?related_post_from=41404\">\r\n        Ruby on Rails \u306b\u3088\u308b\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306e\u81ea\u52d5\u5316\uff1a\u5b9f\u8df5\u30ac\u30a4\u30c9  <\/a>\r\n\r\n        <\/div>\r\n              <div class=\"item\">\r\n            <div class=\"thumb post_thumb\">\r\n    <a  title=\"MLOps\u306e\u305f\u3081\u306eRuby on Rails: ML\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u5b8c\u5168\u30ac\u30a4\u30c9\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/ruby-on-rails-for-mlops-ml%e3%83%87%e3%83%97%e3%83%ad%e3%82%a4%e3%83%a1%e3%83%b3%e3%83%88%e5%ae%8c%e5%85%a8%e3%82%ac%e3%82%a4%e3%83%89\/?related_post_from=41350\">\r\n\r\n      <img decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/05\/Ruby-on-Rails-for-MLOps.png\" class=\"attachment-full size-full wp-post-image\" alt=\"MLOps\u306e\u305f\u3081\u306eRuby on Rails\" srcset=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/05\/Ruby-on-Rails-for-MLOps.png 800w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/05\/Ruby-on-Rails-for-MLOps-300x113.png 300w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/05\/Ruby-on-Rails-for-MLOps-768x288.png 768w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/05\/Ruby-on-Rails-for-MLOps-18x7.png 18w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\r\n\r\n    <\/a>\r\n  <\/div>\r\n\r\n  <a class=\"title post_title\"  title=\"MLOps\u306e\u305f\u3081\u306eRuby on Rails: ML\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u5b8c\u5168\u30ac\u30a4\u30c9\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/ruby-on-rails-for-mlops-ml%e3%83%87%e3%83%97%e3%83%ad%e3%82%a4%e3%83%a1%e3%83%b3%e3%83%88%e5%ae%8c%e5%85%a8%e3%82%ac%e3%82%a4%e3%83%89\/?related_post_from=41350\">\r\n        MLOps\u306e\u305f\u3081\u306eRuby on Rails: ML\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u5b8c\u5168\u30ac\u30a4\u30c9  <\/a>\r\n\r\n        <\/div>\r\n      \r\n  <\/div>\r\n\r\n  <script>\r\n      <\/script>\r\n  <style>\r\n    .related-post {}\r\n\r\n    .related-post .post-list {\r\n      text-align: left;\r\n          }\r\n\r\n    .related-post .post-list .item {\r\n      margin: 10px;\r\n      padding: 10px;\r\n          }\r\n\r\n    .related-post .headline {\r\n      font-size: 14px !important;\r\n      color: #999999 !important;\r\n          }\r\n\r\n    .related-post .post-list .item .post_thumb {\r\n      max-height: 220px;\r\n      margin: 10px 0px;\r\n      padding: 0px;\r\n      display: block;\r\n          }\r\n\r\n    .related-post .post-list .item .post_title {\r\n      font-size: 14px;\r\n      color: #000000;\r\n      margin: 10px 0px;\r\n      padding: 0px;\r\n      display: block;\r\n      text-decoration: none;\r\n          }\r\n\r\n    .related-post .post-list .item .post_excerpt {\r\n      font-size: 12px;\r\n      color: #3f3f3f;\r\n      margin: 10px 0px;\r\n      padding: 0px;\r\n      display: block;\r\n      text-decoration: none;\r\n          }\r\n\r\n    .related-post .owl-dots .owl-dot {\r\n          }\r\n\r\n      <\/style>\r\n      <script>\r\n      jQuery(document).ready(function($) {\r\n        $(\".related-post .post-list\").owlCarousel({\r\n          items: 2,\r\n          responsiveClass: true,\r\n          responsive: {\r\n            0: {\r\n              items: 1,\r\n            },\r\n            768: {\r\n              items: 2,\r\n            },\r\n            1200: {\r\n              items: 2,\r\n            }\r\n          },\r\n                      rewind: true,\r\n                                loop: true,\r\n                                center: false,\r\n                                autoplay: true,\r\n            autoplayHoverPause: true,\r\n                                nav: true,\r\n            navSpeed: 1000,\r\n            navText: ['<i class=\"fas fa-chevron-left\"><\/i>', '<i class=\"fas fa-chevron-right\"><\/i>'],\r\n                                dots: false,\r\n            dotsSpeed: 1200,\r\n                                                    rtl: false,\r\n          \r\n        });\r\n      });\r\n    <\/script>\r\n  <\/div>","protected":false},"excerpt":{"rendered":"<p>Exception handling is a fundamental aspect of robust programming in any language, and Ruby is no exception\u2014pun intended. In Ruby, exceptions represent errors or unexpected conditions that arise during program execution, such as dividing by zero, accessing undefined variables, or failing to open a file. Without proper handling, these exceptions can crash your program, leading to poor user experiences or system failures. This is where Ruby&#8217;s exception handling mechanism comes into play, allowing developers to gracefully manage errors, recover from them, or provide meaningful feedback. It&#8217;s worth noting at the outset that Ruby doesn&#8217;t use the &#8220;try-catch&#8221; syntax familiar from languages like Java or JavaScript. Instead, Ruby employs a structure &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/ruby-on-rails-for-mlops-ml%e3%83%87%e3%83%97%e3%83%ad%e3%82%a4%e3%83%a1%e3%83%b3%e3%83%88%e5%ae%8c%e5%85%a8%e3%82%ac%e3%82%a4%e3%83%89\/\"> <span class=\"screen-reader-text\">MLOps\u306e\u305f\u3081\u306eRuby on Rails: ML\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u5b8c\u5168\u30ac\u30a4\u30c9<\/span> \u3082\u3063\u3068\u8aad\u3080 \"<\/a><\/p>","protected":false},"author":11,"featured_media":40585,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1224],"tags":[],"class_list":["post-40572","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Ruby Try Catch Explained: How Exception Handling Works in Ruby<\/title>\n<meta name=\"description\" content=\"Ruby Try Catch Explained. A clear guide to how exception handling works in Ruby, covering begin, rescue, ensure, and best practices.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.railscarma.com\/ja\/\u30d6\u30ed\u30b0\/ruby-try-catch-\u306e\u8aac\u660e-ruby-\u306b\u304a\u3051\u308b\u4f8b\u5916\u51e6\u7406\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ruby Try Catch Explained: How Exception Handling Works in Ruby\" \/>\n<meta property=\"og:description\" content=\"Ruby Try Catch Explained. A clear guide to how exception handling works in Ruby, covering begin, rescue, ensure, and best practices.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.railscarma.com\/ja\/\u30d6\u30ed\u30b0\/ruby-try-catch-\u306e\u8aac\u660e-ruby-\u306b\u304a\u3051\u308b\u4f8b\u5916\u51e6\u7406\/\" \/>\n<meta property=\"og:site_name\" content=\"RailsCarma - Ruby on Rails Development Company specializing in Offshore Development\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RailsCarma\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-12-15T12:58:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-15T12:58:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/12\/Ruby-Try-Catch-Explained-How-Exception-Handling-Works-in-Ruby.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"ashish\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@railscarma\" \/>\n<meta name=\"twitter:site\" content=\"@railscarma\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"ashish\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"6\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/\"},\"author\":{\"name\":\"ashish\",\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/person\/9699b14852b308edfeb03096b33c7a7a\"},\"headline\":\"Ruby Try Catch Explained: How Exception Handling Works in Ruby\",\"datePublished\":\"2025-12-15T12:58:16+00:00\",\"dateModified\":\"2025-12-15T12:58:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/\"},\"wordCount\":1323,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.railscarma.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/12\/Ruby-Try-Catch-Explained-How-Exception-Handling-Works-in-Ruby.png\",\"articleSection\":[\"Blogs\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/\",\"url\":\"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/\",\"name\":\"Ruby Try Catch Explained: How Exception Handling Works in Ruby\",\"isPartOf\":{\"@id\":\"https:\/\/www.railscarma.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/12\/Ruby-Try-Catch-Explained-How-Exception-Handling-Works-in-Ruby.png\",\"datePublished\":\"2025-12-15T12:58:16+00:00\",\"dateModified\":\"2025-12-15T12:58:22+00:00\",\"description\":\"Ruby Try Catch Explained. A clear guide to how exception handling works in Ruby, covering begin, rescue, ensure, and best practices.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#primaryimage\",\"url\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/12\/Ruby-Try-Catch-Explained-How-Exception-Handling-Works-in-Ruby.png\",\"contentUrl\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/12\/Ruby-Try-Catch-Explained-How-Exception-Handling-Works-in-Ruby.png\",\"width\":800,\"height\":300,\"caption\":\"Ruby Try Catch\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.railscarma.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ruby Try Catch Explained: How Exception Handling Works in Ruby\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.railscarma.com\/#website\",\"url\":\"https:\/\/www.railscarma.com\/\",\"name\":\"RailsCarma - Ruby on Rails Development Company specializing in Offshore Development\",\"description\":\"RailsCarma is a Ruby on Rails Development Company in Bangalore. We specialize in Offshore Ruby on Rails Development based out in USA and India. Hire experienced Ruby on Rails developers for the ultimate Web Experience.\",\"publisher\":{\"@id\":\"https:\/\/www.railscarma.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.railscarma.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.railscarma.com\/#organization\",\"name\":\"RailsCarma\",\"url\":\"https:\/\/www.railscarma.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2020\/08\/railscarma_logo.png\",\"contentUrl\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2020\/08\/railscarma_logo.png\",\"width\":200,\"height\":46,\"caption\":\"RailsCarma\"},\"image\":{\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/RailsCarma\/\",\"https:\/\/x.com\/railscarma\",\"https:\/\/www.linkedin.com\/company\/railscarma\/\",\"https:\/\/myspace.com\/railscarma\",\"https:\/\/in.pinterest.com\/railscarma\/\",\"https:\/\/www.youtube.com\/channel\/UCx3Wil-aAnDARuatTEyMdpg\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/person\/9699b14852b308edfeb03096b33c7a7a\",\"name\":\"ashish\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/204411c7d72714bc32d5ac6398e0596896318386bd537860fdd14ce905a79e07?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/204411c7d72714bc32d5ac6398e0596896318386bd537860fdd14ce905a79e07?s=96&d=mm&r=g\",\"caption\":\"ashish\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ruby Try Catch Explained\uff1aRuby\u306e\u4f8b\u5916\u51e6\u7406\u306e\u4ed5\u7d44\u307f","description":"Ruby Try Catch Explained.Ruby\u306b\u304a\u3051\u308b\u4f8b\u5916\u51e6\u7406\u306e\u4ed5\u7d44\u307f\u306b\u3064\u3044\u3066\u3001begin\u3001rescue\u3001secure\u3001\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u7db2\u7f85\u3057\u305f\u308f\u304b\u308a\u3084\u3059\u3044\u30ac\u30a4\u30c9\u3002.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.railscarma.com\/ja\/\u30d6\u30ed\u30b0\/ruby-try-catch-\u306e\u8aac\u660e-ruby-\u306b\u304a\u3051\u308b\u4f8b\u5916\u51e6\u7406\/","og_locale":"ja_JP","og_type":"article","og_title":"Ruby Try Catch Explained: How Exception Handling Works in Ruby","og_description":"Ruby Try Catch Explained. A clear guide to how exception handling works in Ruby, covering begin, rescue, ensure, and best practices.","og_url":"https:\/\/www.railscarma.com\/ja\/\u30d6\u30ed\u30b0\/ruby-try-catch-\u306e\u8aac\u660e-ruby-\u306b\u304a\u3051\u308b\u4f8b\u5916\u51e6\u7406\/","og_site_name":"RailsCarma - Ruby on Rails Development Company specializing in Offshore Development","article_publisher":"https:\/\/www.facebook.com\/RailsCarma\/","article_published_time":"2025-12-15T12:58:16+00:00","article_modified_time":"2025-12-15T12:58:22+00:00","og_image":[{"width":800,"height":300,"url":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/12\/Ruby-Try-Catch-Explained-How-Exception-Handling-Works-in-Ruby.png","type":"image\/png"}],"author":"ashish","twitter_card":"summary_large_image","twitter_creator":"@railscarma","twitter_site":"@railscarma","twitter_misc":{"\u57f7\u7b46\u8005":"ashish","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"6\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#article","isPartOf":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/"},"author":{"name":"ashish","@id":"https:\/\/www.railscarma.com\/#\/schema\/person\/9699b14852b308edfeb03096b33c7a7a"},"headline":"Ruby Try Catch Explained: How Exception Handling Works in Ruby","datePublished":"2025-12-15T12:58:16+00:00","dateModified":"2025-12-15T12:58:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/"},"wordCount":1323,"commentCount":0,"publisher":{"@id":"https:\/\/www.railscarma.com\/#organization"},"image":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#primaryimage"},"thumbnailUrl":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/12\/Ruby-Try-Catch-Explained-How-Exception-Handling-Works-in-Ruby.png","articleSection":["Blogs"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/","url":"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/","name":"Ruby Try Catch Explained\uff1aRuby\u306e\u4f8b\u5916\u51e6\u7406\u306e\u4ed5\u7d44\u307f","isPartOf":{"@id":"https:\/\/www.railscarma.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#primaryimage"},"image":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#primaryimage"},"thumbnailUrl":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/12\/Ruby-Try-Catch-Explained-How-Exception-Handling-Works-in-Ruby.png","datePublished":"2025-12-15T12:58:16+00:00","dateModified":"2025-12-15T12:58:22+00:00","description":"Ruby Try Catch Explained.Ruby\u306b\u304a\u3051\u308b\u4f8b\u5916\u51e6\u7406\u306e\u4ed5\u7d44\u307f\u306b\u3064\u3044\u3066\u3001begin\u3001rescue\u3001secure\u3001\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u7db2\u7f85\u3057\u305f\u308f\u304b\u308a\u3084\u3059\u3044\u30ac\u30a4\u30c9\u3002.","breadcrumb":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#primaryimage","url":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/12\/Ruby-Try-Catch-Explained-How-Exception-Handling-Works-in-Ruby.png","contentUrl":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/12\/Ruby-Try-Catch-Explained-How-Exception-Handling-Works-in-Ruby.png","width":800,"height":300,"caption":"Ruby Try Catch"},{"@type":"BreadcrumbList","@id":"https:\/\/www.railscarma.com\/blog\/ruby-try-catch-explained-exception-handling-in-ruby\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.railscarma.com\/"},{"@type":"ListItem","position":2,"name":"Ruby Try Catch Explained: How Exception Handling Works in Ruby"}]},{"@type":"WebSite","@id":"https:\/\/www.railscarma.com\/#website","url":"https:\/\/www.railscarma.com\/","name":"RailsCarma - \u30aa\u30d5\u30b7\u30e7\u30a2\u958b\u767a\u306b\u7279\u5316\u3057\u305f Ruby on Rails \u958b\u767a\u4f1a\u793e","description":"RailsCarma \u306f\u30d0\u30f3\u30ac\u30ed\u30fc\u30eb\u306e Ruby on Rails \u958b\u767a\u4f1a\u793e\u3067\u3059\u3002\u5f53\u793e\u306f\u7c73\u56fd\u3068\u30a4\u30f3\u30c9\u3092\u62e0\u70b9\u3068\u3059\u308b\u30aa\u30d5\u30b7\u30e7\u30a2 Ruby on Rails \u958b\u767a\u3092\u5c02\u9580\u3068\u3057\u3066\u3044\u307e\u3059\u3002\u7d4c\u9a13\u8c4a\u5bcc\u306a Ruby on Rails \u958b\u767a\u8005\u3092\u96c7\u3063\u3066\u3001\u7a76\u6975\u306e Web \u30a8\u30af\u30b9\u30da\u30ea\u30a8\u30f3\u30b9\u3092\u5b9f\u73fe\u3057\u307e\u3057\u3087\u3046\u3002","publisher":{"@id":"https:\/\/www.railscarma.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.railscarma.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/www.railscarma.com\/#organization","name":"\u30ec\u30fc\u30eb\u30ab\u30fc\u30de","url":"https:\/\/www.railscarma.com\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.railscarma.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2020\/08\/railscarma_logo.png","contentUrl":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2020\/08\/railscarma_logo.png","width":200,"height":46,"caption":"RailsCarma"},"image":{"@id":"https:\/\/www.railscarma.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RailsCarma\/","https:\/\/x.com\/railscarma","https:\/\/www.linkedin.com\/company\/railscarma\/","https:\/\/myspace.com\/railscarma","https:\/\/in.pinterest.com\/railscarma\/","https:\/\/www.youtube.com\/channel\/UCx3Wil-aAnDARuatTEyMdpg"]},{"@type":"Person","@id":"https:\/\/www.railscarma.com\/#\/schema\/person\/9699b14852b308edfeb03096b33c7a7a","name":"\u30a2\u30b7\u30b7","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.railscarma.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/204411c7d72714bc32d5ac6398e0596896318386bd537860fdd14ce905a79e07?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/204411c7d72714bc32d5ac6398e0596896318386bd537860fdd14ce905a79e07?s=96&d=mm&r=g","caption":"ashish"}}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/posts\/40572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/comments?post=40572"}],"version-history":[{"count":0,"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/posts\/40572\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/media\/40585"}],"wp:attachment":[{"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/media?parent=40572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/categories?post=40572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/tags?post=40572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}