c0a4f9724a3f7eebc2996a3284733aef5236348f
[go-signalcontext.git] / error.go
1 package signalcontext
2
3 import (
4 "fmt"
5 "os"
6 )
7
8 // A Error will be returned by a SignalContext’s Err() method when it
9 // was finished due to a signal (rather than e.g. parent cancellation).
10 type Error struct {
11 os.Signal
12 }
13
14 func (e Error) Error() string {
15 return e.String()
16 }
17
18 func (e Error) String() string {
19 return fmt.Sprintf("received signal: %s", e.Signal)
20 }