diff --git a/app/controllers/concerns/scim_rails/exception_handler.rb b/app/controllers/concerns/scim_rails/exception_handler.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/concerns/scim_rails/exception_handler.rb
+++ b/app/controllers/concerns/scim_rails/exception_handler.rb
@@ -68,6 +68,20 @@ module ScimRails
           )
         end
       end
+
+      ## StandardError must be ordered last or it will catch all exceptions
+      if Rails.env.production?
+        rescue_from StandardError do |e|
+          json_response(
+            {
+              schemas: ["urn:ietf:params:scim:api:messages:2.0:Error"],
+              detail: e.message,
+              status: "500"
+            },
+            :internal_server_error
+          )
+        end
+      end
     end
   end
 end
• rescue StandardError when the unknown goes wrong