Optimize config loading messages #1818

Closed
opened 2026-04-06 02:27:13 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @BlackDex on 1/2/2023

As kinda discussed here #3090, the messages regarding loading the configuration files is a bit strange or unclear. There have been some other reports regarding this in the past, but wasn't that big a of a deal.

But to make the whole process it bit more nice, this PR adjusts the way it reports issues and some small changes to the messages to make it all a bit more clear.

  • Do not report a missing .env file, but only send a message when using one.
  • Exit instead of Panic, a panic causes a stacktrace, which isn't needed here. I'm using a exit code 255 here so it is different to the other exit's we use.
  • Exit on more issues, since if we continue, it could cause configuration issues if the user thinks all is fine.
  • Use the actual env file used in the messages instead of .env.
  • Added a INFO message when loading the config.json. This makes it consistent with the info message for loading the env file.

Resolves #3090

*Originally created by @BlackDex on 1/2/2023* As kinda discussed here #3090, the messages regarding loading the configuration files is a bit strange or unclear. There have been some other reports regarding this in the past, but wasn't that big a of a deal. But to make the whole process it bit more nice, this PR adjusts the way it reports issues and some small changes to the messages to make it all a bit more clear. - Do not report a missing `.env` file, but only send a message when using one. - Exit instead of Panic, a panic causes a stacktrace, which isn't needed here. I'm using a exit code 255 here so it is different to the other exit's we use. - Exit on more issues, since if we continue, it could cause configuration issues if the user thinks all is fine. - Use the actual env file used in the messages instead of `.env`. - Added a **INFO** message when loading the `config.json`. This makes it consistent with the info message for loading the env file. Resolves #3090
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#1818