mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
On uploads, throw exception only if there's an attached debugger.
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
@@ -94,7 +95,7 @@ namespace DiscImageChef.Core
|
|||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
throw;
|
if(Debugger.IsAttached) throw;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -155,7 +156,7 @@ namespace DiscImageChef.Core
|
|||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
throw;
|
if(Debugger.IsAttached) throw;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
@@ -90,13 +91,13 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
throw;
|
if(Debugger.IsAttached) throw;
|
||||||
#else
|
|
||||||
response.Content = new StringContent("error", System.Text.Encoding.UTF8, "text/plain");
|
|
||||||
return response;
|
|
||||||
#endif
|
#endif
|
||||||
|
response.Content = new StringContent("error", Encoding.UTF8, "text/plain");
|
||||||
|
return response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Receives a report from DiscImageChef.Core, verifies it's in the correct format and stores it on the server
|
/// Receives a report from DiscImageChef.Core, verifies it's in the correct format and stores it on the server
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -143,11 +144,10 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
throw;
|
if(Debugger.IsAttached) throw;
|
||||||
#else
|
|
||||||
response.Content = new StringContent("error", System.Text.Encoding.UTF8, "text/plain");
|
|
||||||
return response;
|
|
||||||
#endif
|
#endif
|
||||||
|
response.Content = new StringContent("error", Encoding.UTF8, "text/plain");
|
||||||
|
return response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
@@ -158,9 +159,7 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
{
|
{
|
||||||
addNvs = new OsStats
|
addNvs = new OsStats
|
||||||
{
|
{
|
||||||
name = oldNvs.name,
|
name = oldNvs.name, Value = oldNvs.Value + 1, version = oldNvs.version
|
||||||
Value = oldNvs.Value + 1,
|
|
||||||
version = oldNvs.version
|
|
||||||
};
|
};
|
||||||
removeNvs = oldNvs;
|
removeNvs = oldNvs;
|
||||||
break;
|
break;
|
||||||
@@ -189,8 +188,7 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
{
|
{
|
||||||
addNvs = new NameValueStats
|
addNvs = new NameValueStats
|
||||||
{
|
{
|
||||||
name = oldNvs.name,
|
name = oldNvs.name, Value = oldNvs.Value + newNvs.Value
|
||||||
Value = oldNvs.Value + newNvs.Value
|
|
||||||
};
|
};
|
||||||
removeNvs = oldNvs;
|
removeNvs = oldNvs;
|
||||||
break;
|
break;
|
||||||
@@ -243,8 +241,7 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
{
|
{
|
||||||
addNvs = new NameValueStats
|
addNvs = new NameValueStats
|
||||||
{
|
{
|
||||||
name = oldNvs.name,
|
name = oldNvs.name, Value = oldNvs.Value + newNvs.Value
|
||||||
Value = oldNvs.Value + newNvs.Value
|
|
||||||
};
|
};
|
||||||
removeNvs = oldNvs;
|
removeNvs = oldNvs;
|
||||||
break;
|
break;
|
||||||
@@ -272,8 +269,7 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
{
|
{
|
||||||
addNvs = new NameValueStats
|
addNvs = new NameValueStats
|
||||||
{
|
{
|
||||||
name = oldNvs.name,
|
name = oldNvs.name, Value = oldNvs.Value + newNvs.Value
|
||||||
Value = oldNvs.Value + newNvs.Value
|
|
||||||
};
|
};
|
||||||
removeNvs = oldNvs;
|
removeNvs = oldNvs;
|
||||||
break;
|
break;
|
||||||
@@ -301,8 +297,7 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
{
|
{
|
||||||
addNvs = new NameValueStats
|
addNvs = new NameValueStats
|
||||||
{
|
{
|
||||||
name = oldNvs.name,
|
name = oldNvs.name, Value = oldNvs.Value + newNvs.Value
|
||||||
Value = oldNvs.Value + newNvs.Value
|
|
||||||
};
|
};
|
||||||
removeNvs = oldNvs;
|
removeNvs = oldNvs;
|
||||||
break;
|
break;
|
||||||
@@ -330,8 +325,7 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
{
|
{
|
||||||
addNvs = new NameValueStats
|
addNvs = new NameValueStats
|
||||||
{
|
{
|
||||||
name = oldNvs.name,
|
name = oldNvs.name, Value = oldNvs.Value + newNvs.Value
|
||||||
Value = oldNvs.Value + newNvs.Value
|
|
||||||
};
|
};
|
||||||
removeNvs = oldNvs;
|
removeNvs = oldNvs;
|
||||||
break;
|
break;
|
||||||
@@ -469,12 +463,10 @@ namespace DiscImageChef.Server.Controllers
|
|||||||
catch(Exception ex)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
System.Console.WriteLine("{0} {1}", ex.Message, ex.InnerException);
|
if(Debugger.IsAttached) throw;
|
||||||
throw;
|
|
||||||
#else
|
|
||||||
response.Content = new StringContent("error", System.Text.Encoding.UTF8, "text/plain");
|
|
||||||
return response;
|
|
||||||
#endif
|
#endif
|
||||||
|
response.Content = new StringContent("error", Encoding.UTF8, "text/plain");
|
||||||
|
return response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user