summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Bradley <rick@rickbradley.com>2008-03-31 12:08:36 -0500
committerLuke Kanies <luke@madstop.com>2008-04-11 13:10:36 -0500
commitd24c03c9bbcc35a94a8235c030a73233feabad57 (patch)
tree281a45c8ad4500da0da1c9eee5470ebefaf035f2
parent7a7343458402e493f690633f3cfa78abef316d28 (diff)
downloadpuppet-d24c03c9bbcc35a94a8235c030a73233feabad57.tar.gz
puppet-d24c03c9bbcc35a94a8235c030a73233feabad57.tar.xz
puppet-d24c03c9bbcc35a94a8235c030a73233feabad57.zip
exceptions on remote end now properly passed to local end via REST and re-raised (integration-tested)
-rw-r--r--lib/puppet/network/http/handler.rb2
-rw-r--r--spec/integration/indirector/rest.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb
index b5dcf69d4..f226ae133 100644
--- a/lib/puppet/network/http/handler.rb
+++ b/lib/puppet/network/http/handler.rb
@@ -53,7 +53,7 @@ module Puppet::Network::HTTP::Handler
end
def do_exception(request, response, exception, status=404)
- encode_result(request, response, exception.to_s, status)
+ encode_result(request, response, exception.to_yaml, status)
end
def find_model_for_handler(handler)
diff --git a/spec/integration/indirector/rest.rb b/spec/integration/indirector/rest.rb
index aed17d977..9ac2bc997 100644
--- a/spec/integration/indirector/rest.rb
+++ b/spec/integration/indirector/rest.rb
@@ -79,9 +79,9 @@ describe Puppet::Indirector::REST do
Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:model).returns(@mock_model)
end
- # it "should raise an exception" do
- # lambda { Puppet::TestIndirectedFoo.find('bar') }.should raise_error(RuntimeError)
- # end
+ it "should raise an exception" do
+ lambda { Puppet::TestIndirectedFoo.find('bar') }.should raise_error(RuntimeError)
+ end
end
end