[PR #4402] [MERGED] refactor: replace panic with a graceful exit #3397

Closed
opened 2026-02-05 05:26:42 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/4402
Author: @tessus
Created: 3/4/2024
Status: Merged
Merged: 3/17/2024
Merged by: @dani-garcia

Base: mainHead: fix/panic


📝 Commits (4)

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 src/main.rs (+5 -1)

📄 Description

This change replaces the panic when a wrong log level is used with an error message and a graceful exit.

Please note that I did not hardcode the levels, because I rather dislike hardcoding options, if there's a way to retrieve the list dynamically. It makes the code by 9 lines longer, but it is more futureproof.

Either way, if this is not wanted, I can still hardcode the list.

see https://github.com/dani-garcia/vaultwarden/discussions/4393#discussioncomment-8656343


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/4402 **Author:** [@tessus](https://github.com/tessus) **Created:** 3/4/2024 **Status:** ✅ Merged **Merged:** 3/17/2024 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `fix/panic` --- ### 📝 Commits (4) - [`96e2732`](https://github.com/dani-garcia/vaultwarden/commit/96e27328adcae0e11060508990b67ec8f0299907) refactor: replace panic with a graceful exit - [`bab174e`](https://github.com/dani-garcia/vaultwarden/commit/bab174e648d56270202f7eb6355d47232962af7d) fix: clippy errors - [`d8515cb`](https://github.com/dani-garcia/vaultwarden/commit/d8515cb8ff43e8464430b21d7d30d6ae5a2cb592) fix: typo - [`93c7d8c`](https://github.com/dani-garcia/vaultwarden/commit/93c7d8c2210938958e3a5bcabdc77b8ad904ad2e) Update src/main.rs ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/main.rs` (+5 -1) </details> ### 📄 Description This change replaces the panic when a wrong log level is used with an error message and a graceful exit. Please note that I did not hardcode the levels, because I rather dislike hardcoding options, if there's a way to retrieve the list dynamically. ~~It makes the code by 9 lines longer, but it is more futureproof.~~ Either way, if this is not wanted, I can still hardcode the list. see https://github.com/dani-garcia/vaultwarden/discussions/4393#discussioncomment-8656343 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 05:26:42 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#3397