fix: improve error handling during volume restoration process

- Simplified error handling in the volume restoration logic by removing detailed error messages and stack traces.
- Updated user feedback to provide clearer instructions when a volume is in use, enhancing the user experience during restoration attempts.
- Ensured that the restoration process aborts gracefully with informative messages when prerequisites are not met.
This commit is contained in:
Mauricio Siu
2025-07-01 01:21:54 -06:00
parent c6d760a904
commit 934ec9b16a
2 changed files with 22 additions and 251 deletions

View File

@@ -155,19 +155,9 @@ export const volumeBackupsRouter = createTRPCRouter({
emit.next(
"🎉 All containers/services have been restarted with the restored volume.",
);
} catch (error) {
} catch {
emit.next("");
emit.next("❌ Volume restore failed!");
emit.next(
`💥 Error: ${error instanceof Error ? error.message : "Unknown error"}`,
);
if (error instanceof Error && error.stack) {
emit.next("📋 Stack trace:");
for (const line of error.stack.split("\n")) {
if (line.trim()) emit.next(` ${line}`);
}
}
} finally {
emit.complete();
}