-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
70 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package jaws | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
type ErrPendingCancelled struct { | ||
JawsKey uint64 | ||
Cause error | ||
Initial string | ||
} | ||
|
||
func (e ErrPendingCancelled) Error() string { | ||
return fmt.Sprintf("Request<%s>:%s %v", JawsKeyString(e.JawsKey), e.Initial, e.Cause) | ||
} | ||
|
||
func (e ErrPendingCancelled) Is(target error) (yes bool) { | ||
_, yes = target.(ErrPendingCancelled) | ||
return | ||
} | ||
|
||
func (e ErrPendingCancelled) Unwrap() error { | ||
return e.Cause | ||
} | ||
|
||
func newErrPendingCancelled(rq *Request, cause error) (err error) { | ||
var initial string | ||
if rq.Initial != nil { | ||
initial = fmt.Sprintf(" %s %q:", rq.Initial.Method, rq.Initial.RequestURI) | ||
} | ||
return ErrPendingCancelled{ | ||
JawsKey: rq.JawsKey, | ||
Cause: cause, | ||
Initial: initial, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters