[PR #10956] Fix InvalidOperationException if log file not found #12675

Closed
opened 2026-02-07 06:59:59 +03:00 by OVERLORD · 0 comments
Owner

Original Pull Request: https://github.com/jellyfin/jellyfin/pull/10956

State: closed
Merged: Yes


Changes

API route System/Logs/Log currently throws an InvalidOperationException and returns a 500 if the requested log file does not exist.

I updated this method to handle this edge case and reutrn a 404.

I also added unit tests to check that NotFound is returned if the file does not exist. I was going to add more unit tests for this method, but testing it is slightly difficult due to the lack of abstraction and using FileStream directly.

Issues

None

**Original Pull Request:** https://github.com/jellyfin/jellyfin/pull/10956 **State:** closed **Merged:** Yes --- <!-- Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y). For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our documentation. --> **Changes** <!-- Describe your changes here in 1-5 sentences. --> API route `System/Logs/Log` currently throws an InvalidOperationException and returns a 500 if the requested log file does not exist. I updated this method to handle this edge case and reutrn a 404. I also added unit tests to check that NotFound is returned if the file does not exist. I was going to add more unit tests for this method, but testing it is slightly difficult due to the lack of abstraction and using FileStream directly. **Issues** <!-- Tag any issues that this PR solves here. ex. Fixes # --> None
OVERLORD added the pull-request label 2026-02-07 06:59:59 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#12675