pocke.goevent/errors.go

24 lines
416 B
Go
Raw Normal View History

2015-01-12 13:51:59 +08:00
package goevent
import "fmt"
type EventNotDefined struct {
eventName string
}
func newEventNotDefined(name string) *EventNotDefined {
return &EventNotDefined{
eventName: name,
}
}
func (e *EventNotDefined) Error() string {
return fmt.Sprintf("%s event has not been defined yet.", e.eventName)
}
func (e *EventNotDefined) EventName() string {
return e.eventName
}
2015-01-12 14:13:13 +08:00
var _ error = newEventNotDefined("foo")