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:
xofyarg 2017-06-19 21:57:51 +01:00 committed by Qi Xiao
parent 4a875bbddb
commit deb83e2f8a

View File

@ -47,6 +47,9 @@ func (exc *Exception) Pprint(indent string) string {
if pipeExcs, ok := exc.Cause.(PipelineError); ok {
buf.WriteString("\n" + indent + "Caused by:")
for _, e := range pipeExcs.Errors {
if e == OK {
continue
}
buf.WriteString("\n" + indent + " " + e.Pprint(indent+" "))
}
}