<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,7 @@
 *SVN*
 
+* Make the &quot;no matching servers&quot; error more sane [halorgium]
+
 * Make sure the invoke task gives a sane error when the COMMAND value is omitted [halorgium]
 
 * Make sure variables are conditionally set in the deploy recipes, so as not to clobber values set elsewhere [Jamis Buck]</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -105,7 +105,7 @@ module Capistrano
           servers = find_servers_for_task(task, options)
 
           if servers.empty?
-            raise ScriptError, &quot;`#{task.fully_qualified_name}' is only run for servers matching #{task.options.inspect}, but no servers matched&quot;
+            raise Capistrano::NoMatchingServersError, &quot;`#{task.fully_qualified_name}' is only run for servers matching #{task.options.inspect}, but no servers matched&quot;
           end
 
           if task.continue_on_error?
@@ -114,7 +114,7 @@ module Capistrano
           end
         else
           servers = find_servers(options)
-          raise ScriptError, &quot;no servers found to match #{options.inspect}&quot; if servers.empty?
+          raise Capistrano::NoMatchingServersError, &quot;no servers found to match #{options.inspect}&quot; if servers.empty?
         end
 
         servers = [servers.first] if options[:once]</diff>
      <filename>lib/capistrano/configuration/connections.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@ module Capistrano
 
   class CaptureError &lt; Error; end
   class NoSuchTaskError &lt; Error; end
+  class NoMatchingServersError &lt; Error; end
   
   class RemoteError &lt; Error
     attr_accessor :hosts</diff>
      <filename>lib/capistrano/errors.rb</filename>
    </modified>
    <modified>
      <diff>@@ -160,7 +160,7 @@ HELP
           connect(task)
           configuration.execute_task(task)
         end
-      rescue Capistrano::NoSuchTaskError =&gt; error
+      rescue Capistrano::NoMatchingServersError, Capistrano::NoSuchTaskError =&gt; error
         warn &quot;error: #{error.message}&quot;
       end
 </diff>
      <filename>lib/capistrano/shell.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,14 +3,16 @@ require 'capistrano/server_definition'
 module Capistrano
   # Represents the definition of a single task.
   class TaskDefinition
-    attr_reader :name, :namespace, :options, :body
+    attr_reader :name, :namespace, :options, :body, :desc, :on_error
 
     def initialize(name, namespace, options={}, &amp;block)
       @name, @namespace, @options = name, namespace, options
+      @desc = @options.delete(:desc)
+      @on_error = options.delete(:on_error)
       @body = block or raise ArgumentError, &quot;a task requires a block&quot;
       @servers = nil
     end
-
+    
     # Returns the task's fully-qualified name, including the namespace
     def fully_qualified_name
       @fully_qualified_name ||= begin
@@ -28,7 +30,7 @@ module Capistrano
     def description(rebuild=false)
       @description = nil if rebuild
       @description ||= begin
-        description = options[:desc] || &quot;&quot;
+        description = @desc || &quot;&quot;
 
         indentation = description[/\A\s+/]
         if indentation
@@ -61,7 +63,7 @@ module Capistrano
     # Indicates whether the task wants to continue, even if a server has failed
     # previously
     def continue_on_error?
-      options[:on_error] == :continue
+      @on_error == :continue
     end
   end
 end
\ No newline at end of file</diff>
      <filename>lib/capistrano/task_definition.rb</filename>
    </modified>
    <modified>
      <diff>@@ -138,13 +138,13 @@ class ConfigurationConnectionsTest &lt; Test::Unit::TestCase
 
   def test_execute_on_servers_without_current_task_should_raise_error_if_no_matching_servers
     @config.expects(:find_servers).with(:a =&gt; :b, :c =&gt; :d).returns([])
-    assert_raises(ScriptError) { @config.execute_on_servers(:a =&gt; :b, :c =&gt; :d) { |list| } }
+    assert_raises(Capistrano::NoMatchingServersError) { @config.execute_on_servers(:a =&gt; :b, :c =&gt; :d) { |list| } }
   end
 
   def test_execute_on_servers_should_raise_an_error_if_the_current_task_has_no_matching_servers_by_default
     @config.current_task = mock_task
     @config.expects(:find_servers_for_task).with(@config.current_task, {}).returns([])
-    assert_raises(ScriptError) do
+    assert_raises(Capistrano::NoMatchingServersError) do
       @config.execute_on_servers do
         flunk &quot;should not get here&quot;
       end</diff>
      <filename>test/configuration/connections_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -58,14 +58,14 @@ class ConfigurationNamespacesDSLTest &lt; Test::Unit::TestCase
     @config.desc &quot;A description&quot;
     @config.task(:testing) { puts &quot;foo&quot; }
     @config.task(:another) { puts &quot;bar&quot; }
-    assert_equal &quot;A description&quot;, @config.tasks[:testing].options[:desc]
-    assert_nil @config.tasks[:another].options[:desc]
+    assert_equal &quot;A description&quot;, @config.tasks[:testing].desc
+    assert_nil @config.tasks[:another].desc
   end
 
   def test_pending_desc_should_apply_only_to_next_task_in_any_namespace
     @config.desc &quot;A description&quot;
     @config.namespace(:outer) { task(:testing) { puts &quot;foo&quot; } }
-    assert_equal &quot;A description&quot;, @config.namespaces[:outer].tasks[:testing].options[:desc]
+    assert_equal &quot;A description&quot;, @config.namespaces[:outer].tasks[:testing].desc
   end
 
   def test_defining_task_without_block_should_raise_error</diff>
      <filename>test/configuration/namespace_dsl_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f77c785f38c14b5dc390e1c89a8a86522d148cd1</id>
    </parent>
  </parents>
  <author>
    <name>Jamis Buck</name>
    <email>jamis@37signals.com</email>
  </author>
  <url>http://github.com/jamis/capistrano/commit/4e64823c9347718cae595cd8096371c1961a29c4</url>
  <id>4e64823c9347718cae595cd8096371c1961a29c4</id>
  <committed-date>2007-07-21T14:51:44-07:00</committed-date>
  <authored-date>2007-07-21T14:51:44-07:00</authored-date>
  <message>Make the &quot;no matching servers&quot; error more sane (closes #8828)


git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@7205 5ecf4fe2-1ee6-0310-87b1-e25e094e27de</message>
  <tree>92641e37a819852999c106ae600a53f0d3ede6d8</tree>
  <committer>
    <name>Jamis Buck</name>
    <email>jamis@37signals.com</email>
  </committer>
</commit>
