prisma-client-go
prisma-client-go copied to clipboard
Fatal startup errors don't exit immediately
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"}
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.
I'll take a look later and will ask for clarifications whenever i have to. thanks!