projects
/
eda-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2792dc3
)
Add error checking when creating output file
author
Hugo Villeneuve
<hugo@hugovil.com>
Mon, 6 Jan 2014 16:50:02 +0000
(11:50 -0500)
committer
Hugo Villeneuve
<hugo@hugovil.com>
Fri, 24 Jan 2014 03:54:32 +0000
(22:54 -0500)
bomgen/bomgen.php
patch
|
blob
|
history
diff --git
a/bomgen/bomgen.php
b/bomgen/bomgen.php
index
d38f116
..
d3055a5
100755
(executable)
--- a/
bomgen/bomgen.php
+++ b/
bomgen/bomgen.php
@@
-219,6
+219,10
@@
$workbook = new Spreadsheet_Excel_Writer($dest);
/* Création du worksheet */
$worksheet =& $workbook->addWorksheet($titre);
+if (PEAR::isError($worksheet)) {
+ die($worksheet->getMessage());
+}
+
/* Importation du BOM CSV. */
$data = array();
$row_num = 1;
@@
-416,4
+420,9
@@
xls_configure($workbook, $worksheet);
$workbook->close();
+if (!file_exists($dest)) {
+ echo "Cannot create destination file: " . $dest . "\n";
+ exit(1);
+}
+
?>