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 179 return err 180 180 } 181 181 e.registerCleanup(wid, func(ctx context.Context) error { 182 - err := e.docker.NetworkRemove(ctx, networkName(wid)) 183 - if err != nil { 182 + if err := e.docker.NetworkRemove(ctx, networkName(wid)); err != nil { 184 183 return fmt.Errorf("removing network: %w", err) 185 184 } 186 185 return nil ··· 233 232 return fmt.Errorf("creating container: %w", err) 234 233 } 235 234 e.registerCleanup(wid, func(ctx context.Context) error { 236 - err := e.docker.ContainerStop(ctx, resp.ID, container.StopOptions{}) 237 - if err != nil { 235 + if err := e.docker.ContainerStop(ctx, resp.ID, container.StopOptions{}); err != nil { 238 236 return fmt.Errorf("stopping container: %w", err) 239 237 } 240 238 241 - err = e.docker.ContainerRemove(ctx, resp.ID, container.RemoveOptions{ 239 + err := e.docker.ContainerRemove(ctx, resp.ID, container.RemoveOptions{ 242 240 RemoveVolumes: true, 243 241 RemoveLinks: false, 244 242 Force: false, ··· 249 247 return nil 250 248 }) 251 249 252 - err = e.docker.ContainerStart(ctx, resp.ID, container.StartOptions{}) 253 - if err != nil { 250 + if err := e.docker.ContainerStart(ctx, resp.ID, container.StartOptions{}); err != nil { 254 251 return fmt.Errorf("starting container: %w", err) 255 252 } 256 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
1/3 failed, 2/3 success
expand
expand 0 comments
pull request successfully merged
1 commit
expand
spindle: more verbose error messages
1/3 failed, 2/3 success
expand
expand 0 comments
1 commit
expand
spindle: more verbose error messages
3/3 success
expand
expand 0 comments
1 commit
expand
spindle: more verbose error messages
3/3 success
expand
expand 0 comments
1 commit
expand
spindle: more verbose error messages
3/3 success
expand
expand 0 comments
1 commit
expand
spindle: more verbose error messages
3/3 success
expand
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
3/3 success
expand
expand 0 comments