Monorepo for Tangled tangled.org

spindle: more verbose error messages #887

merged opened by boltless.me targeting master from sl/okmkyytolvko
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.pull/3m7zmleuoyw22
+4 -7
Interdiff #4 โ†’ #5
spindle/db/events.go

This file has not been changed.

+4 -7
spindle/engines/nixery/engine.go
··· 179 return err 180 } 181 e.registerCleanup(wid, func(ctx context.Context) error { 182 - err := e.docker.NetworkRemove(ctx, networkName(wid)) 183 - if err != nil { 184 return fmt.Errorf("removing network: %w", err) 185 } 186 return nil ··· 233 return fmt.Errorf("creating container: %w", err) 234 } 235 e.registerCleanup(wid, func(ctx context.Context) error { 236 - err := e.docker.ContainerStop(ctx, resp.ID, container.StopOptions{}) 237 - if err != nil { 238 return fmt.Errorf("stopping container: %w", err) 239 } 240 241 - err = e.docker.ContainerRemove(ctx, resp.ID, container.RemoveOptions{ 242 RemoveVolumes: true, 243 RemoveLinks: false, 244 Force: false, ··· 249 return nil 250 }) 251 252 - err = e.docker.ContainerStart(ctx, resp.ID, container.StartOptions{}) 253 - if err != nil { 254 return fmt.Errorf("starting container: %w", err) 255 } 256
··· 179 return err 180 } 181 e.registerCleanup(wid, func(ctx context.Context) error { 182 + if err := e.docker.NetworkRemove(ctx, networkName(wid)); err != nil { 183 return fmt.Errorf("removing network: %w", err) 184 } 185 return nil ··· 232 return fmt.Errorf("creating container: %w", err) 233 } 234 e.registerCleanup(wid, func(ctx context.Context) error { 235 + if err := e.docker.ContainerStop(ctx, resp.ID, container.StopOptions{}); err != nil { 236 return fmt.Errorf("stopping container: %w", err) 237 } 238 239 + err := e.docker.ContainerRemove(ctx, resp.ID, container.RemoveOptions{ 240 RemoveVolumes: true, 241 RemoveLinks: false, 242 Force: false, ··· 247 return nil 248 }) 249 250 + if err := e.docker.ContainerStart(ctx, resp.ID, container.StartOptions{}); err != nil { 251 return fmt.Errorf("starting container: %w", err) 252 } 253
spindle/server.go

This file has not been changed.

History

7 rounds 1 comment
sign up or login to add to the discussion
1 commit
expand
spindle: more verbose error messages
expand 0 comments
pull request successfully merged
1 commit
expand
spindle: more verbose error messages
expand 0 comments
1 commit
expand
spindle: more verbose error messages
expand 0 comments
1 commit
expand
spindle: more verbose error messages
expand 0 comments
1 commit
expand
spindle: more verbose error messages
expand 0 comments
1 commit
expand
spindle: more verbose error messages
expand 1 comment

lgtm, though i think we can compress statements of the form:

err := ...
if err != nil {
    ...
}

into:

if err := ...; err != nil {
    ...
}

as long as the subexpression is small (not necessary for this PR!).

1 commit
expand
spindle: more verbose error messages
expand 0 comments