IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 2, 2009, 5:04:16 PM (17 years ago)
Author:
jhoblitt
Message:

croak() instead of die()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/lib/Nebulous/Key.pm

    r24304 r24306  
    1414use File::Spec;
    1515use URI::file;
     16use Carp qw( croak );
    1617use URI;
    1718use overload '""' => \&_stringify_key;
     
    2829    my ($key, $volume) = @_;
    2930
    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;
    3233
    3334    # white space is not allowed
    3435    if ($key =~ qr/\s+/) {
    35         die "keys and URIs may not contain whitespace";
     36        croak "keys and URIs may not contain whitespace";
    3637    }
    3738
     
    4546    if (defined $scheme) {
    4647        # 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"
    4849            unless $scheme eq 'neb';
    4950
     
    6061        # path component to it
    6162        unless (length $path) {
    62             die "neb URI scheme requires a path component";
     63            croak "neb URI scheme requires a path component";
    6364        }
    6465       
     
    7576        # require a leading slash if there is no volume name
    7677        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:/";
    7879        }
    7980    } else {
Note: See TracChangeset for help on using the changeset viewer.