mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
Ignore OK when printing PipelineError (#361)
The program crashes when trying to print PipelineError if there's an OK inside since its content is barely empty. Simple ignore the OK value will fix it. Or maybe we should print that out as well to better align with the pipeline?
This commit is contained in:
parent
4a875bbddb
commit
deb83e2f8a
|
@ -47,6 +47,9 @@ func (exc *Exception) Pprint(indent string) string {
|
||||||
if pipeExcs, ok := exc.Cause.(PipelineError); ok {
|
if pipeExcs, ok := exc.Cause.(PipelineError); ok {
|
||||||
buf.WriteString("\n" + indent + "Caused by:")
|
buf.WriteString("\n" + indent + "Caused by:")
|
||||||
for _, e := range pipeExcs.Errors {
|
for _, e := range pipeExcs.Errors {
|
||||||
|
if e == OK {
|
||||||
|
continue
|
||||||
|
}
|
||||||
buf.WriteString("\n" + indent + " " + e.Pprint(indent+" "))
|
buf.WriteString("\n" + indent + " " + e.Pprint(indent+" "))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user