Generic description to prevent accidental leakage of sensitive data

I get this error when trying to return data from Postgres database. Generic description to prevent accidental leakage of sensitive data. I would like to turn Error Detail on in the connection string but can't figure out how to turn it on. I am trying to create Vapor APIs

1 Like

You need to catch the error and log if yourself, so wrap the offending block in a do/catch.

Note that printing out the connection string is normally a bad idea

I am also facing the error when trying to return data.

You probably have a connection error somewhere. Catch the error and print it out and you should see the underlying problem

Hi @0xTim I have same error, log like below. Please help

[ INFO ] POST /users/create [request-id: F6DAA5D7-757F-46BA-B276-D6903C395240]
[ ERROR ] Opening new connection for pool failed: PSQLError(code: connectionError, underlying: NIOPosix.NIOConnectionError(host: "localhost", port: 5432, dnsAError: nil, dnsAAAAError: nil, connectionErrors: [NIOPosix.SingleConnectionFailure(target: [IPv6]localhost/::1:5432, error: connection reset (error set): Connection refused (errno: 61)), NIOPosix.SingleConnectionFailure(target: [IPv4]localhost/127.0.0.1:5432, error: connection reset (error set): Connection refused (errno: 61))])) [database-id: psql, request-id: F6DAA5D7-757F-46BA-B276-D6903C395240]

You don't have a database server listening on localhost port 5432

1 Like

Yes. my fault. I can create DB and run migration successful now. Thanks.