Introduce APIError type and make ErrorEvent.Err public
This makes it a little bit easier to act on API errors that happen while streaming.
This commit is contained in:
parent
9faaa4f0dc
commit
972ffb4771
6 changed files with 49 additions and 24 deletions
|
@ -40,10 +40,10 @@ type DeleteEvent struct{ ID ID }
|
|||
func (e *DeleteEvent) event() {}
|
||||
|
||||
// ErrorEvent is a struct for passing errors to app.
|
||||
type ErrorEvent struct{ err error }
|
||||
type ErrorEvent struct{ Err error }
|
||||
|
||||
func (e *ErrorEvent) event() {}
|
||||
func (e *ErrorEvent) Error() string { return e.err.Error() }
|
||||
func (e *ErrorEvent) Error() string { return e.Err.Error() }
|
||||
|
||||
// Event is an interface passing events to app.
|
||||
type Event interface {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue