formatSimple performs a best effort at extracting the details at a given level of wrapping when the error object does not implement the Formatter interface. Returns true if we want to elide errors from causal chain.
(err, cause error)
| 575 | // the Formatter interface. |
| 576 | // Returns true if we want to elide errors from causal chain. |
| 577 | func (s *state) formatSimple(err, cause error) bool { |
| 578 | var pref string |
| 579 | elideCauses := false |
| 580 | if cause != nil { |
| 581 | var messageType MessageType |
| 582 | pref, messageType = extractPrefix(err, cause) |
| 583 | if messageType == FullMessage { |
| 584 | elideCauses = true |
| 585 | } |
| 586 | } else { |
| 587 | pref = err.Error() |
| 588 | } |
| 589 | if len(pref) > 0 { |
| 590 | s.Write([]byte(pref)) |
| 591 | } |
| 592 | return elideCauses |
| 593 | } |
| 594 | |
| 595 | // finishDisplay renders s.finalBuf into s.State. |
| 596 | func (p *state) finishDisplay(verb rune) { |
no test coverage detected