try/catch does not work for client.connect():
const { Pool, Client } = require('pg')
try {
const client = new Client(config)
client.connect()
} catch (er) {
console.log('error')
}
Error:
UnhandledPromiseRejectionWarning: error: password authentication failed for user '...'
How can I change the async connect()
to sync for try/catch?