prisma-client-go icon indicating copy to clipboard operation
prisma-client-go copied to clipboard

Fatal startup errors don't exit immediately

Open steebchen opened this issue 3 years ago • 2 comments

The following results in a un-readiness error after a few seconds, instead of pretty-printing this error and immediately exiting:

{"is_panic":false,"message":"\u001b[1;91merror\u001b[0m: \u001b[1mEnvironment variable not found: DATABASE_URL.\u001b[0m\n  \u001b[1;94m-->\u001b[0m  \u001b[4mschema.prisma:10\u001b[0m\n\u001b[1;94m   | \u001b[0m\n\u001b[1;94m 9 | \u001b[0m  provider = \"postgresql\"\n\u001b[1;94m10 | \u001b[0m  url      = \u001b[1;91menv(\"DATABASE_URL\")\u001b[0m\n\u001b[1;94m   | \u001b[0m\n\nValidation Error Count: 1","meta":{"full_error":"\u001b[1;91merror\u001b[0m: \u001b[1mEnvironment variable not found: DATABASE_URL.\u001b[0m\n  \u001b[1;94m-->\u001b[0m  \u001b[4mschema.prisma:10\u001b[0m\n\u001b[1;94m   | \u001b[0m\n\u001b[1;94m 9 | \u001b[0m  provider = \"postgresql\"\n\u001b[1;94m10 | \u001b[0m  url      = \u001b[1;91menv(\"DATABASE_URL\")\u001b[0m\n\u001b[1;94m   | \u001b[0m\n\nValidation Error Count: 1"},"error_code":"P1012"}

steebchen avatar Oct 18 '20 16:10 steebchen

This issue needs to either have some check in the engine startup and probably some general log reading from the engine which is streamed via jsonrpc, parsing it and then printing the message property and the code or something like that – I'm not so sure myself.

steebchen avatar Oct 29 '20 08:10 steebchen

I'll take a look later and will ask for clarifications whenever i have to. thanks!

OAyomide avatar Oct 29 '20 15:10 OAyomide