mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 09:48:49 +02:00
fix: nil panic when formatting error
This commit is contained in:
@@ -73,7 +73,7 @@ var spaces = []byte(" ")
|
|||||||
type appendLineFunc func(buf []byte, err error, level int) []byte
|
type appendLineFunc func(buf []byte, err error, level int) []byte
|
||||||
|
|
||||||
func (err *nestedError) Error() string {
|
func (err *nestedError) Error() string {
|
||||||
if err == nil {
|
if err.Err == nil {
|
||||||
return nilError.Error()
|
return nilError.Error()
|
||||||
}
|
}
|
||||||
buf := appendLineNormal(nil, err.Err, 0)
|
buf := appendLineNormal(nil, err.Err, 0)
|
||||||
@@ -85,7 +85,7 @@ func (err *nestedError) Error() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (err *nestedError) Plain() []byte {
|
func (err *nestedError) Plain() []byte {
|
||||||
if err == nil {
|
if err.Err == nil {
|
||||||
return appendLinePlain(nil, nilError, 0)
|
return appendLinePlain(nil, nilError, 0)
|
||||||
}
|
}
|
||||||
buf := appendLinePlain(nil, err.Err, 0)
|
buf := appendLinePlain(nil, err.Err, 0)
|
||||||
@@ -97,7 +97,7 @@ func (err *nestedError) Plain() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (err *nestedError) Markdown() []byte {
|
func (err *nestedError) Markdown() []byte {
|
||||||
if err == nil {
|
if err.Err == nil {
|
||||||
return appendLineMd(nil, nilError, 0)
|
return appendLineMd(nil, nilError, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user