mirror of
https://github.com/slawkens/myaac.git
synced 2026-04-23 19:03:31 +02:00
[WIP] Refactoring - Uniform error message + TOML exception catch
This commit is contained in:
@@ -19,7 +19,15 @@ class Mounts
|
||||
}
|
||||
|
||||
$toml = file_get_contents($file);
|
||||
$mounts = Toml::decode($toml, asArray: true);
|
||||
|
||||
try {
|
||||
$mounts = Toml::decode($toml, asArray: true);
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
error('Error: Cannot load mounts.toml. More info in system/logs/error.log file.');
|
||||
log_append('error.log', "[" . __CLASS__ . "] Fatal error: Cannot load mounts.toml - $file. Error: " . $e->getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($mounts as $name => $mount)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user