<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -126,7 +126,7 @@ class Heroku::Client
 		post(&quot;/apps/#{app_name}/rake&quot;, cmd)
 	rescue RestClient::RequestFailed =&gt; e
 		raise(AppCrashed, e.response.body) if e.response.code.to_i == 502
-		raise
+		raise e
 	end
 
 	# support for console sessions
@@ -151,7 +151,7 @@ class Heroku::Client
 		end
 	rescue RestClient::RequestFailed =&gt; e
 		raise(AppCrashed, e.response.body) if e.response.code.to_i == 502
-		raise
+		raise e
 	end
 
 	# internal method to run console commands formatting the output</diff>
      <filename>lib/heroku/client.rb</filename>
    </modified>
    <modified>
      <diff>@@ -110,6 +110,20 @@ EOXML
 		@client.cron_logs('myapp').should == 'cron log'
 	end
 
+	it &quot;rake catches 502s and shows the app crashlog&quot; do
+		e = RestClient::RequestFailed.new
+		e.stub!(:response).and_return(mock('response', :code =&gt; '502', :body =&gt; 'the crashlog'))
+		@client.should_receive(:post).and_raise(e)
+		lambda { @client.rake('myapp', '') }.should raise_error(Heroku::Client::AppCrashed)
+	end
+
+	it &quot;rake passes other status codes (i.e., 500) as standard restclient exceptions&quot; do
+		e = RestClient::RequestFailed.new
+		e.stub!(:response).and_return(mock('response', :code =&gt; '500', :body =&gt; 'not a crashlog'))
+		@client.should_receive(:post).and_raise(e)
+		lambda { @client.rake('myapp', '') }.should raise_error(RestClient::RequestFailed)
+	end
+
 	describe &quot;collaborators&quot; do
 		it &quot;list(app_name) -&gt; list app collaborators&quot; do
 			@client.should_receive(:resource).with('/apps/myapp/collaborators').and_return(@resource)</diff>
      <filename>spec/client_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0c8dd8e17664b8c2214ad70678bdcf3b6a3f9b78</id>
    </parent>
  </parents>
  <author>
    <name>Adam Wiggins</name>
    <email>adam@heroku.com</email>
  </author>
  <url>http://github.com/adamwiggins/heroku-client/commit/5828429ac5142c5698f93a8fb77ec8f1e73e20ea</url>
  <id>5828429ac5142c5698f93a8fb77ec8f1e73e20ea</id>
  <committed-date>2009-02-03T13:33:38-08:00</committed-date>
  <authored-date>2009-02-03T13:33:38-08:00</authored-date>
  <message>spec rake catching of crashlogs</message>
  <tree>19b67c0a02040f6c00071b07aaff52e960ad3387</tree>
  <committer>
    <name>Adam Wiggins</name>
    <email>adam@heroku.com</email>
  </committer>
</commit>
