1
0
Fork 0
mirror of https://github.com/fluffle/goirc synced 2025-05-12 10:41:42 +00:00

Port sp0rkle's panic recovery back into goirc.

This commit is contained in:
Alex Bramley 2013-03-10 13:30:00 +00:00
parent 5f2665dde8
commit ac9d05efa2
3 changed files with 44 additions and 6 deletions

View file

@ -68,6 +68,9 @@ type Config struct {
// Sent as the QUIT message.
QuitMessage string
// Configurable panic recovery for all handlers.
Recover func(*Conn, *Line)
}
func NewConfig(nick string, args ...string) *Config {
@ -75,6 +78,7 @@ func NewConfig(nick string, args ...string) *Config {
Me: state.NewNick(nick),
PingFreq: 3 * time.Minute,
NewNick: func(s string) string { return s + "_" },
Recover: (*Conn).LogPanic, // in dispatch.go
}
cfg.Me.Ident = "goirc"
if len(args) > 0 && args[0] != "" {