|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Web.Mvc;
|
|
|
|
|
using NLog;
|
|
|
|
|
using NzbDrone.Common;
|
|
|
|
|
using NzbDrone.Common.Contract;
|
|
|
|
|
using NzbDrone.Services.Service.Repository.Reporting;
|
|
|
|
|
using PetaPoco;
|
|
|
|
@ -11,6 +13,7 @@ namespace NzbDrone.Services.Service.Controllers
|
|
|
|
|
public class ReportingController : Controller
|
|
|
|
|
{
|
|
|
|
|
private readonly IDatabase _database;
|
|
|
|
|
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
|
|
|
|
|
|
|
|
|
private const string OK = "OK";
|
|
|
|
|
|
|
|
|
@ -22,6 +25,8 @@ namespace NzbDrone.Services.Service.Controllers
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public JsonResult ParseError(ParseErrorReport parseErrorReport)
|
|
|
|
|
{
|
|
|
|
|
logger.Trace(parseErrorReport.NullCheck());
|
|
|
|
|
|
|
|
|
|
if (ParseErrorExists(parseErrorReport.Title))
|
|
|
|
|
return Json(OK);
|
|
|
|
|
|
|
|
|
@ -43,16 +48,25 @@ namespace NzbDrone.Services.Service.Controllers
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public JsonResult ReportException(ExceptionReport exceptionReport)
|
|
|
|
|
{
|
|
|
|
|
var row = new ExceptionRow();
|
|
|
|
|
row.LoadBase(exceptionReport);
|
|
|
|
|
row.LogMessage = exceptionReport.LogMessage;
|
|
|
|
|
row.Logger = exceptionReport.Logger;
|
|
|
|
|
row.String = exceptionReport.String;
|
|
|
|
|
row.Type = exceptionReport.Type;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var row = new ExceptionRow();
|
|
|
|
|
row.LoadBase(exceptionReport);
|
|
|
|
|
row.LogMessage = exceptionReport.LogMessage;
|
|
|
|
|
row.Logger = exceptionReport.Logger;
|
|
|
|
|
row.String = exceptionReport.String;
|
|
|
|
|
row.Type = exceptionReport.Type;
|
|
|
|
|
|
|
|
|
|
_database.Insert(row);
|
|
|
|
|
_database.Insert(row);
|
|
|
|
|
|
|
|
|
|
return Json(OK);
|
|
|
|
|
return Json(OK);
|
|
|
|
|
}
|
|
|
|
|
catch(Exception)
|
|
|
|
|
{
|
|
|
|
|
logger.Trace(exceptionReport.NullCheck());
|
|
|
|
|
throw;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|