summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Net/HTTP/API/Spec.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Net/HTTP/API/Spec.pm b/lib/Net/HTTP/API/Spec.pm
index 6fcd6d4..39f9680 100644
--- a/lib/Net/HTTP/API/Spec.pm
+++ b/lib/Net/HTTP/API/Spec.pm
@@ -3,12 +3,17 @@ package Net::HTTP::API::Spec;
 use JSON;
 use Moose;
 use IO::All;
+use Carp;
 
 use Net::HTTP::API::Core;
 
 sub new_from_spec {
     my ($class, $spec_file) = @_;
 
+    if (! -f $spec_file) {
+        Carp::confess ("$spec_file does not exists");
+    }
+
     my $content < io($spec_file);
     my $spec = JSON::decode_json($content);