Changeset 24306 for trunk/Nebulous-Server
- Timestamp:
- Jun 2, 2009, 5:04:16 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous-Server/lib/Nebulous/Key.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/lib/Nebulous/Key.pm
r24304 r24306 14 14 use File::Spec; 15 15 use URI::file; 16 use Carp qw( croak ); 16 17 use URI; 17 18 use overload '""' => \&_stringify_key; … … 28 29 my ($key, $volume) = @_; 29 30 30 die"key param is not optional" unless defined $key;31 die"too many params" if scalar @_ > 2;31 croak "key param is not optional" unless defined $key; 32 croak "too many params" if scalar @_ > 2; 32 33 33 34 # white space is not allowed 34 35 if ($key =~ qr/\s+/) { 35 die"keys and URIs may not contain whitespace";36 croak "keys and URIs may not contain whitespace"; 36 37 } 37 38 … … 45 46 if (defined $scheme) { 46 47 # if so, does it use the neb scheme? 47 die"URI does not use the 'neb' scheme"48 croak "URI does not use the 'neb' scheme" 48 49 unless $scheme eq 'neb'; 49 50 … … 60 61 # path component to it 61 62 unless (length $path) { 62 die"neb URI scheme requires a path component";63 croak "neb URI scheme requires a path component"; 63 64 } 64 65 … … 75 76 # require a leading slash if there is no volume name 76 77 if ((not defined $volume_name) and (not $path =~ m|^/|)) { 77 die"neb URI scheme requires a leading slash, eg. neb:/";78 croak "neb URI scheme requires a leading slash, eg. neb:/"; 78 79 } 79 80 } else {
Note:
See TracChangeset
for help on using the changeset viewer.
