fix: propagate error from createDirectory in system start (#1785)

- `SystemStart` used `try!` when creating the apiserver
  data directory. File system operations can fail for
  legitimate reasons: insufficient permissions, disk full,
  read-only volume. Crashing the process in these cases
  gives the user no actionable error message.
- Replaced with `try` so the error propagates up and is
  surfaced cleanly.
This commit is contained in:
SEPURI-SAI-KRISHNA
2026-06-25 21:38:40 -07:00
committed by GitHub
parent 0c95007763
commit 0b6c79f3d3
@@ -104,7 +104,7 @@ extension Application {
let apiServerDataPath = appRoot.appending(FilePath.Component("apiserver"))
let apiServerDataURL = URL(fileURLWithPath: apiServerDataPath.string)
try! FileManager.default.createDirectory(at: apiServerDataURL, withIntermediateDirectories: true)
try FileManager.default.createDirectory(at: apiServerDataURL, withIntermediateDirectories: true)
var env = PluginLoader.filterEnvironment()
env[ApplicationRoot.environmentName] = appRoot.string