Skip to content

Commit

Permalink
fix: correct message when root pin failed
Browse files Browse the repository at this point in the history
this also correctly exits CLI commands with code 1 (was silent
false-positive 0 before)
  • Loading branch information
lidel committed Jun 13, 2023
1 parent 78cd620 commit 4bcfe07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/commands/dag/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Specification of CAR formats: https://ipld.io/specs/transport/car/
}

if event.Root.PinErrorMsg != "" {
event.Root.PinErrorMsg = fmt.Sprintf("FAILED: %s", event.Root.PinErrorMsg)
return fmt.Errorf("pinning root %q FAILED: %s", enc.Encode(event.Root.Cid), event.Root.PinErrorMsg)
} else {
event.Root.PinErrorMsg = "success"
}
Expand Down

0 comments on commit 4bcfe07

Please sign in to comment.