Skip to content

Commit

Permalink
改進 table-build.php 處理錯誤的方法
Browse files Browse the repository at this point in the history
  • Loading branch information
yookoala committed Jan 7, 2015
1 parent 48768c8 commit 4c569e7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions webdata/scripts/table-build.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@
$p = pathinfo($m);
$o = new $p['filename'];
if($o instanceof Pix_Table) {
$o->dropTable();
try {
$o->dropTable();
} catch (Pix_Table_Exception $e) {
echo 'Unable to drop table "'.$p['filename'].'". '."\n";
if (preg_match('/^Table: \w+SQL Error: \(1051\)Unknown table/',
$e->getMessage())) {
echo 'Table missing. Ignore'."\n";
} else {
die($e->getMessage());
}
}
$o->createTable();
}
}
}

0 comments on commit 4c569e7

Please sign in to comment.