[WIP] Refactoring - Uniform error message + TOML exception catch

This commit is contained in:
slawkens
2026-03-01 21:45:48 +01:00
parent 4ca79a1e85
commit fbb5034458
12 changed files with 92 additions and 38 deletions

View File

@@ -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)
{