From 02c3bdde20c31d4aa50caf067cad173953d73995 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 25 Mar 2020 14:15:25 +0100 Subject: [PATCH] Error out when storing unsupported SASL mechanism in DB --- db.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db.go b/db.go index e511c89..61c9780 100644 --- a/db.go +++ b/db.go @@ -2,6 +2,7 @@ package soju import ( "database/sql" + "fmt" "sync" _ "github.com/mattn/go-sqlite3" @@ -163,6 +164,8 @@ func (db *DB) StoreNetwork(username string, network *Network) error { case "PLAIN": saslPlainUsername = toStringPtr(network.SASL.Plain.Username) saslPlainPassword = toStringPtr(network.SASL.Plain.Password) + default: + return fmt.Errorf("soju: cannot store network: unsupported SASL mechanism %q", network.SASL.Mechanism) } }