Skip to content

Commit

Permalink
fix: correct message when root pin failed
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Jun 13, 2023
1 parent b30f46b commit 14eed26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/commands/dag/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,19 @@ Specification of CAR formats: https://ipld.io/specs/transport/car/
return err
}

var rootStatus string
if event.Root.PinErrorMsg != "" {
rootStatus = "Error pinning"
event.Root.PinErrorMsg = fmt.Sprintf("FAILED: %s", event.Root.PinErrorMsg)
} else {
rootStatus = "Pinned root"
event.Root.PinErrorMsg = "success"
}

_, err = fmt.Fprintf(
w,
"Pinned root\t%s\t%s\n",
"%s\t%s\t%s\n",
rootStatus,
enc.Encode(event.Root.Cid),
event.Root.PinErrorMsg,
)
Expand Down

0 comments on commit 14eed26

Please sign in to comment.