mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-03 18:48:40 +00:00
Fix photo uploading and add more detailed logging to deserialization
This commit is contained in:
parent
c48da8ccd7
commit
a2d2337dc3
2 changed files with 8 additions and 4 deletions
|
@ -102,8 +102,9 @@ public static partial class ControllerExtensions
|
|||
if (matchedRoot == null)
|
||||
{
|
||||
Logger.Error($"[{controller.ControllerContext.ActionDescriptor.ActionName}] " +
|
||||
$"Failed to deserialize {typeof(T).Name}: Unable to match root element", LogArea.Deserialization);
|
||||
Logger.Error($"{bodyString}", LogArea.Deserialization);
|
||||
$"Failed to deserialize {typeof(T).Name}: Unable to match root element\n" +
|
||||
$"xmlData: '{bodyString}'",
|
||||
LogArea.Deserialization);
|
||||
return default;
|
||||
}
|
||||
root = new XmlRootAttribute(matchedRoot);
|
||||
|
@ -116,8 +117,10 @@ public static partial class ControllerExtensions
|
|||
catch (Exception e)
|
||||
{
|
||||
Logger.Error($"[{controller.ControllerContext.ActionDescriptor.ActionName}] " +
|
||||
$"Failed to deserialize {typeof(T).Name}: {e.Message}", LogArea.Deserialization);
|
||||
Logger.Error($"{bodyString}", LogArea.Deserialization);
|
||||
$"Failed to deserialize {typeof(T).Name}:\n" +
|
||||
$"xmlData: '{bodyString}'\n" +
|
||||
$"detailedException: '{e.ToDetailedException()}",
|
||||
LogArea.Deserialization);
|
||||
}
|
||||
return default;
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ public class Photo
|
|||
[XmlElement("plan")]
|
||||
public string PlanHash { get; set; } = "";
|
||||
|
||||
[XmlIgnore]
|
||||
public virtual ICollection<PhotoSubject> PhotoSubjects { get; set; } = new HashSet<PhotoSubject>();
|
||||
|
||||
public int CreatorId { get; set; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue