mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-03 10:38: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)
|
if (matchedRoot == null)
|
||||||
{
|
{
|
||||||
Logger.Error($"[{controller.ControllerContext.ActionDescriptor.ActionName}] " +
|
Logger.Error($"[{controller.ControllerContext.ActionDescriptor.ActionName}] " +
|
||||||
$"Failed to deserialize {typeof(T).Name}: Unable to match root element", LogArea.Deserialization);
|
$"Failed to deserialize {typeof(T).Name}: Unable to match root element\n" +
|
||||||
Logger.Error($"{bodyString}", LogArea.Deserialization);
|
$"xmlData: '{bodyString}'",
|
||||||
|
LogArea.Deserialization);
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
root = new XmlRootAttribute(matchedRoot);
|
root = new XmlRootAttribute(matchedRoot);
|
||||||
|
@ -116,8 +117,10 @@ public static partial class ControllerExtensions
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Logger.Error($"[{controller.ControllerContext.ActionDescriptor.ActionName}] " +
|
Logger.Error($"[{controller.ControllerContext.ActionDescriptor.ActionName}] " +
|
||||||
$"Failed to deserialize {typeof(T).Name}: {e.Message}", LogArea.Deserialization);
|
$"Failed to deserialize {typeof(T).Name}:\n" +
|
||||||
Logger.Error($"{bodyString}", LogArea.Deserialization);
|
$"xmlData: '{bodyString}'\n" +
|
||||||
|
$"detailedException: '{e.ToDetailedException()}",
|
||||||
|
LogArea.Deserialization);
|
||||||
}
|
}
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,7 @@ public class Photo
|
||||||
[XmlElement("plan")]
|
[XmlElement("plan")]
|
||||||
public string PlanHash { get; set; } = "";
|
public string PlanHash { get; set; } = "";
|
||||||
|
|
||||||
|
[XmlIgnore]
|
||||||
public virtual ICollection<PhotoSubject> PhotoSubjects { get; set; } = new HashSet<PhotoSubject>();
|
public virtual ICollection<PhotoSubject> PhotoSubjects { get; set; } = new HashSet<PhotoSubject>();
|
||||||
|
|
||||||
public int CreatorId { get; set; }
|
public int CreatorId { get; set; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue