Error out when storing unsupported SASL mechanism in DB
This commit is contained in:
parent
63db290229
commit
02c3bdde20
3
db.go
3
db.go
@ -2,6 +2,7 @@ package soju
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
_ "github.com/mattn/go-sqlite3"
|
_ "github.com/mattn/go-sqlite3"
|
||||||
@ -163,6 +164,8 @@ func (db *DB) StoreNetwork(username string, network *Network) error {
|
|||||||
case "PLAIN":
|
case "PLAIN":
|
||||||
saslPlainUsername = toStringPtr(network.SASL.Plain.Username)
|
saslPlainUsername = toStringPtr(network.SASL.Plain.Username)
|
||||||
saslPlainPassword = toStringPtr(network.SASL.Plain.Password)
|
saslPlainPassword = toStringPtr(network.SASL.Plain.Password)
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("soju: cannot store network: unsupported SASL mechanism %q", network.SASL.Mechanism)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user