diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-08-30 23:44:48 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-08-30 23:44:48 +0900 |
| commit | 712cfc06d7e541c6e28b4b127a4760b4cfccffa8 (patch) | |
| tree | 3dbd2bc0fc03ba5d108646b342392f5fdf841c90 /container/init.go | |
| parent | f5abce9df5727904a1daa246025a87c4bfe62553 (diff) | |
container: wrap container init start errors
This helps indicate the exact origin and nature of the error. This eliminates generic WrapErr from container.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/init.go')
| -rw-r--r-- | container/init.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/container/init.go b/container/init.go index e56b4cf0..c2208be4 100644 --- a/container/init.go +++ b/container/init.go @@ -116,7 +116,7 @@ func initEntrypoint(k syscallDispatcher, prepareLogger func(prefix string), setV if errors.Is(err, EBADF) { k.fatal("invalid setup descriptor") } - if errors.Is(err, ErrNotSet) { + if errors.Is(err, ErrReceiveEnv) { k.fatal("HAKUREI_SETUP not set") } @@ -187,10 +187,7 @@ func initEntrypoint(k syscallDispatcher, prepareLogger func(prefix string), setV if m, ok := messageFromError(err); ok { k.fatal(m) } else { - k.printBaseErr(err, - fmt.Sprintf("cannot prepare op at index %d:", i)) - k.beforeExit() - k.exit(1) + k.fatalf("cannot prepare op at index %d: %v", i, err) } } } @@ -231,10 +228,7 @@ func initEntrypoint(k syscallDispatcher, prepareLogger func(prefix string), setV if m, ok := messageFromError(err); ok { k.fatal(m) } else { - k.printBaseErr(err, - fmt.Sprintf("cannot apply op at index %d:", i)) - k.beforeExit() - k.exit(1) + k.fatalf("cannot apply op at index %d: %v", i, err) } } } |
