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:
parent
5f2665dde8
commit
ac9d05efa2
3 changed files with 44 additions and 6 deletions
|
@ -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] != "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue