unified error tips

This commit is contained in:
gouguoyin 2021-08-06 14:00:22 +02:00
parent 0f0d190dbc
commit 7b8ded9b1e

View File

@ -16,15 +16,15 @@ var invalidDurationError = func(duration string) error {
// 无效的时间字符串错误
var invalidValueError = func(value string) error {
return fmt.Errorf("cannot parse %q to carbon, please make sure the value is valid", value)
return fmt.Errorf("cannot parse %q as carbon, please make sure the value is valid", value)
}
// 无效的布局模板错误
var invalidLayoutError = func(value, layout string) error {
return fmt.Errorf("cannot parse %q as layout %q to carbon, please make sure the value and layout match", value, layout)
return fmt.Errorf("cannot parse %q as carbon by layout %q, please make sure the value and layout match", value, layout)
}
// 无效的格式化字符错误
var invalidFormatError = func(value, format string) error {
return fmt.Errorf("cannot parse %q as format %q to carbon, please make sure the value and format match", value, format)
return fmt.Errorf("cannot parse %q as carbon by format %q, please make sure the value and format match", value, format)
}