Skip to content

Commit cd42b4a

Browse files
committed
change the missing password error message to be more descriptive
1 parent 7b7ef2a commit cd42b4a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pgmoon/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,15 +341,15 @@ do
341341
end
342342
end,
343343
cleartext_auth = function(self, msg)
344-
assert(self.config.password, "missing password, required for connect")
344+
assert(self.config.password, "the database is requesting a password for authentication but you did not provide a password")
345345
self:send_message(MSG_TYPE_F.password, {
346346
self.config.password,
347347
NULL
348348
})
349349
return self:check_auth()
350350
end,
351351
scram_sha_256_auth = function(self, msg)
352-
assert(self.config.password, "missing password, required for connect")
352+
assert(self.config.password, "the database is requesting a password for authentication but you did not provide a password")
353353
local random_bytes, x509_digest
354354
do
355355
local _obj_0 = require("pgmoon.crypto")

pgmoon/init.moon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ class Postgres
339339
error "don't know how to auth: #{auth_type}"
340340

341341
cleartext_auth: (msg) =>
342-
assert @config.password, "missing password, required for connect"
342+
assert @config.password, "the database is requesting a password for authentication but you did not provide a password"
343343

344344
@send_message MSG_TYPE_F.password, {
345345
@config.password
@@ -350,7 +350,7 @@ class Postgres
350350

351351
-- https://www.postgresql.org/docs/current/sasl-authentication.html#SASL-SCRAM-SHA-256
352352
scram_sha_256_auth: (msg) =>
353-
assert @config.password, "missing password, required for connect"
353+
assert @config.password, "the database is requesting a password for authentication but you did not provide a password"
354354

355355
import random_bytes, x509_digest from require "pgmoon.crypto"
356356

0 commit comments

Comments
 (0)