Merge pull request #16246 from lcorbasson/lcorbasson-patch-1
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
Tests / run-tests (macos-latest) (push) Has been cancelled
Tests / run-tests (ubuntu-latest) (push) Has been cancelled
Tests / run-tests (windows-latest) (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Artifact (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Unstable Spec (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Stable Spec (push) Has been cancelled
Project Automation / Project board (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled

Add the filename to exceptions in DeserializeFromFile()
This commit is contained in:
Bond-009
2026-05-06 17:41:20 +02:00
committed by GitHub

View File

@@ -85,9 +85,17 @@ namespace Emby.Server.Implementations.Serialization
/// <returns>System.Object.</returns>
public object? DeserializeFromFile(Type type, string file)
{
using (var stream = File.OpenRead(file))
try
{
return DeserializeFromStream(type, stream);
using (var stream = File.OpenRead(file))
{
return DeserializeFromStream(type, stream);
}
}
catch (Exception ex)
{
ex.Data.Add("Filename", file);
throw;
}
}