Changeset 47 for trunk/cgi-bin/main.cgi


Ignore:
Timestamp:
11/01/04 12:05:34 (20 years ago)
Author:
Kris Deugau
Message:

/trunk

Bugfixes on error reporting: Make sure to syslog before exiting,
and report the DB/Perl error in the browser.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/main.cgi

    r46 r47  
    139139    eval { $ip_dbh->rollback; };
    140140    syslog "err", "Could not add master block '$webvar{cidr}' to database: '$@'";
    141     printAndExit("Could not add master block $webvar{cidr} to database");
     141    printAndExit("Could not add master block $webvar{cidr} to database: $@");
    142142  }
    143143
     
    984984    $sth->execute;
    985985    if ($sth->err) {
    986       printAndExit("Allocation of $cidr to $webvar{custid} failed: '".$sth->errstr."'");
    987986      syslog "err", "Allocation of $cidr to $webvar{custid} by $authuser failed: ".
    988987        "'".$sth->errstr."'";
     988      printAndExit("Allocation of $cidr to $webvar{custid} failed: '".$sth->errstr."'");
    989989    }
    990990    print qq(<div class="center"><div class="heading">The IP $cidr has been allocated to customer $webvar{custid}</div></div>);
     
    11691169      if ($webvar{city} !~ /^(?:Huntsville|North Bay|Ottawa|Pembroke|Sault Ste. Marie|Sudbury|Timmins|Thunder Bay|Toronto)$/) {
    11701170        printAndExit("Please choose a valid POP location for a routed netblock.  Valid ".
    1171                 "POP locations are currently:<br>\n Huntsville - North Bay - Ottawa -".
     1171                "POP locations are currently:<br>\n Elliot Lake - Huntsville - North Bay -".
     1172                " Ottawa -".
    11721173                " Pembroke - Sault Ste. Marie - Sudbury - Timmins - Thunder Bay - Toronto");
    11731174      }
     
    12851286    eval { $ip_dbh->rollback; };
    12861287    syslog "err", "$authuser could not update block/IP '$webvar{block}': '$@'";
    1287     printAndExit("Could not update block/IP $webvar{block}");
     1288    printAndExit("Could not update block/IP $webvar{block}: $@");
    12881289  }
    12891290
     
    14241425      eval { $ip_dbh->rollback; };
    14251426      syslog "err", "$authuser could not deallocate static IP '$webvar{block}': '$@'";
    1426       printAndExit("Could not deallocate static IP $webvar{block}");
     1427      printAndExit("Could not deallocate static IP $webvar{block}: $@");
    14271428    }
    14281429    print "<div class=heading align=center>Success!  $webvar{block} deallocated.</div>\n";
     
    14421443      eval { $ip_dbh->rollback; };
    14431444      syslog "err", "$authuser could not remove master block '$webvar{block}': '$@'";
    1444       printAndExit("Could not remove master block $webvar{block}");
     1445      printAndExit("Could not remove master block $webvar{block}: $@");
    14451446    }
    14461447    print "<div class=heading align=center>Success!  Master $webvar{block} removed.</div>\n";
     
    15381539      eval { $ip_dbh->rollback; };
    15391540      syslog "err", "$authuser could not deallocate netblock '$webvar{block}': '$@'";
    1540       printAndExit("Could not deallocate netblock $webvar{block}");
     1541      printAndExit("Could not deallocate netblock $webvar{block}: $@");
    15411542    }
    15421543    print "<div class=heading align=center>Success!  $webvar{block} deleted.</div>\n";
Note: See TracChangeset for help on using the changeset viewer.