Add file missed in previous commit.
authorSteve Peters <steve@fisharerojo.org>
Tue, 14 Apr 2009 05:21:05 +0000 (00:21 -0500)
committerSteve Peters <steve@fisharerojo.org>
Tue, 14 Apr 2009 05:21:05 +0000 (00:21 -0500)
lib/CPAN/Exception/blocked_urllist.pm [new file with mode: 0644]

diff --git a/lib/CPAN/Exception/blocked_urllist.pm b/lib/CPAN/Exception/blocked_urllist.pm
new file mode 100644 (file)
index 0000000..0df385b
--- /dev/null
@@ -0,0 +1,40 @@
+# -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*-
+# vim: ts=4 sts=4 sw=4:
+package CPAN::Exception::blocked_urllist;
+use strict;
+use overload '""' => "as_string";
+
+use vars qw(
+            $VERSION
+);
+$VERSION = "1.0";
+
+
+sub new {
+    my($class) = @_;
+    bless {}, $class;
+}
+
+sub as_string {
+    my($self) = shift;
+    if ($CPAN::Config->{connect_to_internet_ok}) {
+        return qq{
+
+You have not configured a urllist. Please consider to set it with
+
+    o conf init urllist
+
+};
+    } else {
+        return qq{
+
+You have not configured a urllist and did not allow to connect to the
+internet. Please consider to call
+
+    o conf init connect_to_internet_ok urllist
+
+};
+    }
+}
+
+1;