IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 9, 2009, 2:57:48 PM (17 years ago)
Author:
jhoblitt
Message:

don't logdie() inside of eval {};

File:
1 edited

Legend:

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

    r24362 r24363  
    427427                    $query->finish;
    428428                }
    429                 $log->logdie("failed to get LAST_INSERT_ID()")
     429                die("failed to get LAST_INSERT_ID()")
    430430                    unless $parent_id;
    431431
     
    504504            unless ($rows == 1) {
    505505                $query->finish;
    506                 $log->logdie("affected row count is $rows instead of 1");
     506                die("affected row count is $rows instead of 1");
    507507            }
    508508
     
    591591              unless ($rows == 1) {
    592592                  $query->finish;
    593                   $log->logdie("affected row count is $rows instead of 1");
     593                  die("affected row count is $rows instead of 1");
    594594              }
    595595          }
     
    604604              unless ($rows == 1) {
    605605                  $query->finish;
    606                   $log->logdie("affected row count is $rows instead of 1");
     606                  die("affected row count is $rows instead of 1");
    607607              }
    608608          }
     
    617617              unless ($rows == 1) {
    618618                  $query->finish;
    619                   $log->logdie("affected row count is $rows instead of 1");
     619                  die("affected row count is $rows instead of 1");
    620620              }
    621621          }
     
    733733                unless ( $rows > 0 ) {
    734734                    $query->finish;
    735                     $log->logdie( "storage object does not exist" );
     735                    die( "storage object does not exist" );
    736736                }
    737737
     
    854854                unless ( $rows == 1 ) {
    855855                    $query->finish;
    856                     $log->logdie( "storage object does not exist" );
     856                    die( "storage object does not exist" );
    857857                }
    858858
     
    869869                # can't set a write lock if there are read locks
    870870                if ($write_lock) {
    871                     $log->logdie("can not write lock twice -- retry");
     871                    die("can not write lock twice -- retry");
    872872                }
    873873               
    874874                if ($read_lock > 0) {
    875                     $log->logdie("can not write lock after read lock -- retry");
     875                    die("can not write lock after read lock -- retry");
    876876                }
    877877
     
    882882                    # if we affected more then one row something very bad has happened.
    883883                    unless ($rows == 1) {
    884                         $log->logdie("affected row count is $rows instead of 1");
     884                        die("affected row count is $rows instead of 1");
    885885                    }
    886886
     
    889889                # can't set a read lock if there's a write lock
    890890                if ($write_lock) {
    891                     $log->logdie("can not read lock after write lock -- retry");
     891                    die("can not read lock after write lock -- retry");
    892892                }
    893893
     
    898898                    # if we affected more then one row something very bad has happened.
    899899                    unless ($rows == 1) {
    900                         $log->logdie("affected row count is $rows instead of 1");
     900                        die("affected row count is $rows instead of 1");
    901901                    }
    902902                }
     
    968968                unless ($rows == 1) {
    969969                    $query->finish;
    970                     $log->logdie("storage object does not exist");
     970                    die("storage object does not exist");
    971971                }
    972972
     
    982982                # can't remove a write lock if it doesn't exist
    983983                if ($read_lock) {
    984                     $log->logdie("can not have a write lock under a read lock");
     984                    die("can not have a write lock under a read lock");
    985985                }
    986986
    987987                unless ($write_lock) {
    988                     $log->logdie("can not remove non-existant write lock");
     988                    die("can not remove non-existant write lock");
    989989                }
    990990
     
    995995                    # if we affected more then one row something very bad has happened.
    996996                    unless ($rows == 1) {
    997                         $log->logdie("affected row count is $rows instead of 1");
     997                        die("affected row count is $rows instead of 1");
    998998                    }
    999999                }
     
    10021002                # can't remove a read lock if there aren't any
    10031003                if ($write_lock) {
    1004                     $log->logdie("can not have a read lock under a write lock");
     1004                    die("can not have a read lock under a write lock");
    10051005                }
    10061006                   
    10071007                if ($read_lock == 0) {
    1008                     $log->logdie("can not remove non-existant read lock");
     1008                    die("can not remove non-existant read lock");
    10091009                }
    10101010
     
    10151015                    # if we affected more then one row something very bad has happened.
    10161016                    unless ($rows == 1) {
    1017                         $log->logdie("affected row count is $rows instead of 1");
     1017                        die("affected row count is $rows instead of 1");
    10181018                    }
    10191019
     
    11011101            if ($flags eq 'create') {
    11021102                unless ($rows == 1) {
    1103                     $log->logdie( "affected row count is $rows instead of 1" );
     1103                    die( "affected row count is $rows instead of 1" );
    11041104                }
    11051105            } else {
     
    11071107                # the case of a replace and 1 if the xattr didn't already exist.
    11081108                unless ($rows == 1 or $rows == 2) {
    1109                     $log->logdie( "affected row count is $rows instead of 2" );
     1109                    die( "affected row count is $rows instead of 2" );
    11101110                }
    11111111            }
     
    11741174        if ($rows == 0) {
    11751175            $query->finish;
    1176             $log->logdie( "xattr $key:$name does not exist" );
     1176            die( "xattr $key:$name does not exist" );
    11771177        }
    11781178        # if we go more then one row bad something very bad has happened.
    11791179        unless ($rows == 1) {
    11801180            $query->finish;
    1181             $log->logdie( "affected row count is $rows instead of 1" );
     1181            die( "affected row count is $rows instead of 1" );
    11821182        }
    11831183
     
    12821282            # no rows affected means the xattr did not exist
    12831283            if ($rows == 0) {
    1284                 $log->logdie( "xattr $key:$name does not exist" );
     1284                die( "xattr $key:$name does not exist" );
    12851285            }
    12861286
    12871287            # if we affected more then one row something very bad has happened.
    12881288            if ($rows > 1) {
    1289                 $log->logdie( "affected row count is $rows instead of 1" );
     1289                die( "affected row count is $rows instead of 1" );
    12901290            }
    12911291
     
    14811481            unless ($rows > 0) {
    14821482                $query->finish;
    1483                 $log->logdie("no instances on storage volume or volume is not avaiable for key: $key volume: $vol_name");
     1483                die("no instances on storage volume or volume is not avaiable for key: $key volume: $vol_name");
    14841484            }
    14851485        } else {
     
    14891489            unless ($rows > 0) {
    14901490                $query->finish;
    1491                 $log->logdie("no instances available for key: $key");
     1491                die("no instances available for key: $key");
    14921492            }
    14931493        }
     
    15591559                unless ( $rows > 0 ) {
    15601560                    $query->finish;
    1561                     $log->logdie( "no instance is associated with uri" );
     1561                    die( "no instance is associated with uri" );
    15621562                }
    15631563
     
    15841584                # has happened
    15851585                unless ( $rows == 1 ) {
    1586                     $log->logdie( "affected row count is $rows instead of 1" );
     1586                    die( "affected row count is $rows instead of 1" );
    15871587                }
    15881588            }
     
    16011601                # TODO: this will have to be changed in order to support hardlinks
    16021602                unless ( $rows == 1 ) {
    1603                     $log->logdie( "affected row count is $rows instead of 2" );
     1603                    die( "affected row count is $rows instead of 2" );
    16041604                }
    16051605            }
     
    16581658
    16591659        unless ($rows == 1) {
    1660             $log->logdie("no storage object found");
     1660            die("no storage object found");
    16611661        }
    16621662
     
    18171817                    return; # this just returns out of the eval not from the subroutine
    18181818                }
    1819                 $log->logdie("storage volume: $name is not available");
     1819                die("storage volume: $name is not available");
    18201820            }
    18211821            # when matching by name we shouldn't ever match more than once
    18221822            if ($rows > 1) {
    18231823                $query->finish;
    1824                 $log->logdie("affected row count is $rows instead of 1");
     1824                die("affected row count is $rows instead of 1");
    18251825            }
    18261826        } else {
     
    18311831            unless ($rows > 0) {
    18321832                $query->finish;
    1833                 $log->logdie("no storage volume is available for key: $key volume: $name hard_volume: $hard_volume");
     1833                die("no storage volume is available for key: $key volume: $name hard_volume: $hard_volume");
    18341834            }
    18351835        }
     
    18731873        unless ($rows > 0) {
    18741874            $query->finish;
    1875             $log->logdie("can't find a suitable storage volume to replicate $key to");
     1875            die("can't find a suitable storage volume to replicate $key to");
    18761876        }
    18771877        # when matching by name we shouldn't ever match more than once
    18781878        if ($rows > 1) {
    18791879            $query->finish;
    1880             $log->logdie("affected row count is $rows instead of 1");
     1880            die("affected row count is $rows instead of 1");
    18811881        }
    18821882
     
    20222022        unless (-d $storage_path) {
    20232023            $self->_retry(sub { mkpath([$storage_path], 0, 0775) })
    2024                 or $log->logdie("can't create storage path: $storage_path");
     2024                or die("can't create storage path: $storage_path");
    20252025        }
    20262026        # check to make sure at least the parent directory has the proper
     
    20302030            $log->error("$storage_path has the wrong permissions of: 0", sprintf("%o", $mode));
    20312031            $self->_retry(sub { chmod(0775, $storage_path) })
    2032                 or $log->logdie("can not chmod() $storage_path: $!");
     2032                or die("can not chmod() $storage_path: $!");
    20332033        }
    20342034
Note: See TracChangeset for help on using the changeset viewer.