This is a submission for DEV's Summer Bug Smash: Smash Stories powered by Sentry.
We've all spent hours debugging a broken piece of code. But what happens when your code is supposed to fail, but it actually succeeds?
Recently, while going through Curso.dev (a popular web development course in Brazil), I decided to stray from the "happy path." I wanted to intentionally trigger a database connection error using the node-pg-migrate package.
Specifically, I wanted to see how the tool would behave if I forgot to pass the --envPath flag, which should have prevented it from accessing the DATABASE_URL variable.
My expectation: Since DATABASE_URL was empty, I expected a clear connection error (something like client password must be a string or a generic connection failure).






