diff --git a/lib/sinatra/showexceptions.rb b/lib/sinatra/showexceptions.rb
index <HASH>..<HASH> 100644
--- a/lib/sinatra/showexceptions.rb
+++ b/lib/sinatra/showexceptions.rb
@@ -22,7 +22,7 @@ module Sinatra
     rescue Exception => e
       errors, env["rack.errors"] = env["rack.errors"], @@eats_errors
 
-      if respond_to?(:prefers_plain_text?) and prefers_plain_text?(env)
+      if prefers_plain_text?(env)
         content_type = "text/plain"
         body = [dump_exception(e)]
       else
@@ -40,6 +40,10 @@ module Sinatra
 
     private
 
+    def prefers_plain_text?(env)
+      [/curl/].index{|item| item =~ env["HTTP_USER_AGENT"]}
+    end
+
     def frame_class(frame)
       if frame.filename =~ /lib\/sinatra.*\.rb/
         "framework"
Added plain text stack trace output if a cURL user agent is detected.