summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-10-17 21:42:33 +0200
committerfranck cuny <franck@lumberjaph.net>2010-10-17 21:42:33 +0200
commit1b3b92231f53d412587ed9d951efce3cd1584c17 (patch)
tree43c5800a99dc05523e1d06c4fabadf0342b89c98
parentreflect specification update (diff)
downloadnet-http-spore-1b3b92231f53d412587ed9d951efce3cd1584c17.tar.gz
don't rely on net::http::api::error
-rw-r--r--lib/Net/HTTP/Spore/Meta/Method/Spore.pm10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Net/HTTP/Spore/Meta/Method/Spore.pm b/lib/Net/HTTP/Spore/Meta/Method/Spore.pm
index 4c6fe71..1cea574 100644
--- a/lib/Net/HTTP/Spore/Meta/Method/Spore.pm
+++ b/lib/Net/HTTP/Spore/Meta/Method/Spore.pm
@@ -3,7 +3,8 @@ package Net::HTTP::Spore::Meta::Method::Spore;
 # ABSTRACT: declare API method
 
 use Moose::Role;
-use Net::HTTP::API::Error;
+use Carp qw/confess/;
+
 use Net::HTTP::Spore::Meta::Method;
 use MooseX::Types::Moose qw/Str ArrayRef/;
 
@@ -44,8 +45,7 @@ sub remove_spore_method {
 before add_spore_method => sub {
     my ($meta, $name) = @_;
     if ($meta->_find_spore_method_by_name(sub {/^$name$/})) {
-        die Net::HTTP::API::Error->new(
-            reason => "method '$name' is already declared in " . $meta->name);
+        confess "method '$name' is already delcared in ".$meta->name;
     }
 };
 
@@ -72,9 +72,7 @@ after add_spore_method => sub {
         $name,
         sub {
             my $self = shift;
-            die Net::HTTP::API::Error->new(
-                reason => "'api_base_url' have not been defined")
-              unless $self->api_base_url;
+            die Net::HTTP::Spore::Response->new(599, [], {error => "'base_url' have not been defined"}) unless $self->base_url;
         }
     );
 };