[PR #4881] [MERGED] Wrap ensureDir in try-catch blocks in manager classes #4363

Closed
opened 2026-04-25 00:19:26 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4881
Author: @mikiher
Created: 12/1/2025
Status: Merged
Merged: 12/1/2025
Merged by: @advplyr

Base: masterHead: wrap-ensure-dir


📝 Commits (2)

  • 5f1edcb Wrap ensureDir in try-catch blocks
  • d7bfccd BackupManager: Remove backup fallback logic

📊 Changes

5 files changed (+47 additions, -22 deletions)

View changed files

📝 server/managers/BackupManager.js (+8 -3)
📝 server/managers/CacheManager.js (+9 -4)
📝 server/managers/LogManager.js (+18 -13)
📝 server/managers/MigrationManager.js (+6 -1)
📝 server/managers/PlaybackSessionManager.js (+6 -1)

📄 Description

Brief summary

This wraps ensureDir calls in try catch blocks on some of the manager classes.
It's done to try to debug issues experienced by some users reported in this abs-windows bug

Which issue is fixed?

Currently no issue. If I find the root cause the abs-windows bug, I will likely open a corresponding server issue.

In-depth Description

Since the current failure unfortunately does not contain a stack trace and is not caught by any try-catch block, I put a try-catch block around suspected ensureDir calls and log an error before re-throwing.

How have you tested this?

I just brought up a server and made sure everythiing still works.
This will not change any existing functionality - it just logs errors in the location they happened so they can be identified.


🔄 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/advplyr/audiobookshelf/pull/4881 **Author:** [@mikiher](https://github.com/mikiher) **Created:** 12/1/2025 **Status:** ✅ Merged **Merged:** 12/1/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `wrap-ensure-dir` --- ### 📝 Commits (2) - [`5f1edcb`](https://github.com/advplyr/audiobookshelf/commit/5f1edcb60969cbede473c5b5a6c88316d86ab935) Wrap ensureDir in try-catch blocks - [`d7bfccd`](https://github.com/advplyr/audiobookshelf/commit/d7bfccdc4a43a3f682849062b1effafb00812fee) BackupManager: Remove backup fallback logic ### 📊 Changes **5 files changed** (+47 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `server/managers/BackupManager.js` (+8 -3) 📝 `server/managers/CacheManager.js` (+9 -4) 📝 `server/managers/LogManager.js` (+18 -13) 📝 `server/managers/MigrationManager.js` (+6 -1) 📝 `server/managers/PlaybackSessionManager.js` (+6 -1) </details> ### 📄 Description ## Brief summary This wraps `ensureDir` calls in try catch blocks on some of the manager classes. It's done to try to debug issues experienced by some users reported in [this abs-windows bug](https://github.com/mikiher/audiobookshelf-windows/issues/56) ## Which issue is fixed? Currently no issue. If I find the root cause the abs-windows bug, I will likely open a corresponding server issue. ## In-depth Description Since the current failure unfortunately does not contain a stack trace and is not caught by any try-catch block, I put a try-catch block around suspected `ensureDir` calls and log an error before re-throwing. ## How have you tested this? I just brought up a server and made sure everythiing still works. This will not change any existing functionality - it just logs errors in the location they happened so they can be identified. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:19:26 +02:00
adam closed this issue 2026-04-25 00:19:26 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4363