File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -23,16 +23,28 @@ func (x *Error) Wrapped() error {
2323 return x .wrapped
2424}
2525
26+ type ErrorString struct {
27+ Msg string `json:"msg"`
28+ }
29+
30+ func (x ErrorString ) Error () string {
31+ return x .Msg
32+ }
33+
2634func mkErr (ctx context.Context , wrapped error ) * Error {
27- return & Error {Ctx : ctx , Stack : debug .Stack (), wrapped : wrapped }
35+ return & Error {
36+ Ctx : ctx ,
37+ Stack : debug .Stack (),
38+ wrapped : wrapped ,
39+ }
2840}
2941
3042func Panic (ctx context.Context , err error ) {
3143 panic (mkErr (ctx , err ))
3244}
3345
3446func Errorf (ctx context.Context , format string , args ... any ) {
35- Panic (ctx , fmt .Errorf (format , args ... ))
47+ Panic (ctx , ErrorString { Msg : fmt .Sprintf (format , args ... )} )
3648}
3749
3850func Assert (ctx context.Context , cond bool , err error ) {
You can’t perform that action at this time.
0 commit comments