add error stack for internal error printing

This commit is contained in:
John Guo
2022-01-28 14:51:49 +08:00
parent 1a000396e2
commit 04eb654133
55 changed files with 175 additions and 240 deletions

View File

@ -63,7 +63,7 @@ func BeEncode(values ...interface{}) []byte {
buf.Write(BeEncodeFloat64(value))
default:
if err := binary.Write(buf, binary.BigEndian, value); err != nil {
intlog.Error(context.TODO(), err)
intlog.Errorf(context.TODO(), `%+v`, err)
buf.Write(BeEncodeString(fmt.Sprintf("%v", value)))
}
}

View File

@ -63,7 +63,7 @@ func LeEncode(values ...interface{}) []byte {
buf.Write(LeEncodeFloat64(value))
default:
if err := binary.Write(buf, binary.LittleEndian, value); err != nil {
intlog.Error(context.TODO(), err)
intlog.Errorf(context.TODO(), `%+v`, err)
buf.Write(LeEncodeString(fmt.Sprintf("%v", value)))
}
}

View File

@ -109,7 +109,7 @@ func getEncoding(charset string) encoding.Encoding {
}
enc, err := ianaindex.MIB.Encoding(charset)
if err != nil {
intlog.Error(context.TODO(), err)
intlog.Errorf(context.TODO(), `%+v`, err)
}
return enc
}