Skip to content

Commit 0b6c79f

Browse files
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.
1 parent 0c95007 commit 0b6c79f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Sources/ContainerCommands/System/SystemStart.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ extension Application {
104104

105105
let apiServerDataPath = appRoot.appending(FilePath.Component("apiserver"))
106106
let apiServerDataURL = URL(fileURLWithPath: apiServerDataPath.string)
107-
try! FileManager.default.createDirectory(at: apiServerDataURL, withIntermediateDirectories: true)
107+
try FileManager.default.createDirectory(at: apiServerDataURL, withIntermediateDirectories: true)
108108

109109
var env = PluginLoader.filterEnvironment()
110110
env[ApplicationRoot.environmentName] = appRoot.string

0 commit comments

Comments
 (0)