fopen error messages
This commit is contained in:
parent
1834f24c9f
commit
ef0ecf243a
|
@ -112,6 +112,9 @@ HELP;
|
||||||
$filename = $this->getArgument(1);
|
$filename = $this->getArgument(1);
|
||||||
$blocklist = $config->get('system', 'blocklist', []);
|
$blocklist = $config->get('system', 'blocklist', []);
|
||||||
$fp = fopen($filename, 'w');
|
$fp = fopen($filename, 'w');
|
||||||
|
if (!$fp) {
|
||||||
|
throw new Exception(sprintf('The file "%s" could not be created.', $filename));
|
||||||
|
}
|
||||||
foreach ($blocklist as $domain) {
|
foreach ($blocklist as $domain) {
|
||||||
fputcsv($fp, $domain);
|
fputcsv($fp, $domain);
|
||||||
}
|
}
|
||||||
|
@ -156,6 +159,8 @@ HELP;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
throw new Exception(sprintf('The file "%s" could not be opened for importing', $filename));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue