<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,7 +2,6 @@ require &quot;webrat/core/configuration&quot;
 require &quot;webrat/core/xml&quot;
 require &quot;webrat/core/nokogiri&quot;
 require &quot;webrat/core/logging&quot;
-require &quot;webrat/core/flunk&quot;
 require &quot;webrat/core/form&quot;
 require &quot;webrat/core/scope&quot;
 require &quot;webrat/core/link&quot;</diff>
      <filename>lib/webrat/core.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,22 +8,22 @@ module Webrat
       find_field_with_id(*args) ||
       find_field_named(*args)   ||
       field_labeled(*args)      ||
-      flunk(&quot;Could not find field: #{args.inspect}&quot;)
+      raise(NotFoundError.new(&quot;Could not find field: #{args.inspect}&quot;))
     end
     
     def field_labeled(label, *field_types)
       find_field_labeled(label, *field_types) ||
-      flunk(&quot;Could not find field labeled #{label.inspect}&quot;)
+      raise(NotFoundError.new(&quot;Could not find field labeled #{label.inspect}&quot;))
     end
 
     def field_named(name, *field_types)
       find_field_named(name, *field_types) ||
-      flunk(&quot;Could not find field named #{name.inspect}&quot;)
+      raise(NotFoundError.new(&quot;Could not find field named #{name.inspect}&quot;))
     end
     
     def field_with_id(id, *field_types)
       find_field_with_id(id, *field_types) ||
-      flunk(&quot;Could not find field with id #{id.inspect}&quot;)
+      raise(NotFoundError.new(&quot;Could not find field with id #{id.inspect}&quot;))
     end
     
     def find_field_labeled(label, *field_types) #:nodoc:
@@ -56,7 +56,7 @@ module Webrat
         return select_option if select_option
       end
         
-      flunk(&quot;Could not find option #{option_text.inspect}&quot;)
+      raise NotFoundError.new(&quot;Could not find option #{option_text.inspect}&quot;)
     end
     
     def find_button(value) #:nodoc:
@@ -67,13 +67,13 @@ module Webrat
       if button
         return button
       else
-        flunk(&quot;Could not find button #{value.inspect}&quot;)
+        raise NotFoundError.new(&quot;Could not find button #{value.inspect}&quot;)
       end
     end
     
     def find_area(area_name) #:nodoc:
       areas.detect { |area| area.matches_text?(area_name) } ||
-      flunk(&quot;Could not find area with name #{area_name}&quot;)
+      raise(NotFoundError.new(&quot;Could not find area with name #{area_name}&quot;))
     end
     
     def find_link(text_or_title_or_id) #:nodoc:
@@ -84,7 +84,7 @@ module Webrat
       if matching_links.any?
         matching_links.min { |a, b| a.text.length &lt;=&gt; b.text.length }
       else
-        flunk(&quot;Could not find link with text or title or id #{text_or_title_or_id.inspect}&quot;)
+        raise NotFoundError.new(&quot;Could not find link with text or title or id #{text_or_title_or_id.inspect}&quot;)
       end
     end
 
@@ -93,7 +93,7 @@ module Webrat
       if label
         label.for_id
       else
-        flunk(&quot;Could not find the label with text #{label_text}&quot;)
+        raise NotFoundError.new(&quot;Could not find the label with text #{label_text}&quot;)
       end
     end
     </diff>
      <filename>lib/webrat/core/locators.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,9 +2,11 @@ require &quot;webrat/core/form&quot;
 require &quot;webrat/core/locators&quot;
 
 module Webrat
+  class NotFoundError &lt; WebratError
+  end
+  
   class Scope
     include Logging
-    include Flunk
     include Locators
     
     def self.from_page(session, response, response_body) #:nodoc:
@@ -96,7 +98,7 @@ module Webrat
         option.choose
       else
         select_box_text = options[:from] ? &quot; in the '#{options[:from]}' select box&quot; : '' 
-        flunk(&quot;The '#{option_text}' option was not found#{select_box_text}&quot;) 
+        raise NotFoundError.new(&quot;The '#{option_text}' option was not found#{select_box_text}&quot;) 
        end
     end
 
@@ -131,7 +133,7 @@ module Webrat
       
       id_prefix = locate_id_prefix(options) do
         year_field = find_field_with_id(/(.*?)_#{DATE_TIME_SUFFIXES[:year]}$/)
-        flunk(&quot;No date fields were found&quot;) unless year_field &amp;&amp; year_field.id =~ /(.*?)_1i/
+        raise NotFoundError.new(&quot;No date fields were found&quot;) unless year_field &amp;&amp; year_field.id =~ /(.*?)_1i/
         $1
       end
         
@@ -165,7 +167,7 @@ module Webrat
 
       id_prefix = locate_id_prefix(options) do
         hour_field = find_field_with_id(/(.*?)_#{DATE_TIME_SUFFIXES[:hour]}$/)
-        flunk(&quot;No time fields were found&quot;) unless hour_field &amp;&amp; hour_field.id =~ /(.*?)_4i/
+        raise NotFoundError.new(&quot;No time fields were found&quot;) unless hour_field &amp;&amp; hour_field.id =~ /(.*?)_4i/
         $1
       end
         </diff>
      <filename>lib/webrat/core/scope.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/webrat/core/flunk.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>df9d8179c0d8ed2061c5f91a9dd55d8c86fc5e26</id>
    </parent>
  </parents>
  <author>
    <name>Bryan Helmkamp</name>
    <email>bryan@brynary.com</email>
  </author>
  <url>http://github.com/brynary/webrat/commit/10d5d7695f2754637912608aa2707d65dae9602b</url>
  <id>10d5d7695f2754637912608aa2707d65dae9602b</id>
  <committed-date>2008-11-18T17:55:55-08:00</committed-date>
  <authored-date>2008-11-18T17:55:55-08:00</authored-date>
  <message>Raise Webrat::NotFoundErrors instead of RuntimeErrors to make error catching easier</message>
  <tree>5289b3e93d14988324f4e54ecabf2d07f60c3f25</tree>
  <committer>
    <name>Bryan Helmkamp</name>
    <email>bryan@brynary.com</email>
  </committer>
</commit>
