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.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
@@ -94,7 +95,7 @@ namespace DiscImageChef.Core
|
||||
catch
|
||||
{
|
||||
#if DEBUG
|
||||
throw;
|
||||
if(Debugger.IsAttached) throw;
|
||||
#endif
|
||||
}
|
||||
});
|
||||
@@ -155,7 +156,7 @@ namespace DiscImageChef.Core
|
||||
catch
|
||||
{
|
||||
#if DEBUG
|
||||
throw;
|
||||
if(Debugger.IsAttached) throw;
|
||||
#endif
|
||||
}
|
||||
});
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
@@ -90,13 +91,13 @@ namespace DiscImageChef.Server.Controllers
|
||||
catch
|
||||
{
|
||||
#if DEBUG
|
||||
throw;
|
||||
#else
|
||||
response.Content = new StringContent("error", System.Text.Encoding.UTF8, "text/plain");
|
||||
return response;
|
||||
if(Debugger.IsAttached) throw;
|
||||
#endif
|
||||
response.Content = new StringContent("error", Encoding.UTF8, "text/plain");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Receives a report from DiscImageChef.Core, verifies it's in the correct format and stores it on the server
|
||||
/// </summary>
|
||||
@@ -143,11 +144,10 @@ namespace DiscImageChef.Server.Controllers
|
||||
catch
|
||||
{
|
||||
#if DEBUG
|
||||
throw;
|
||||
#else
|
||||
response.Content = new StringContent("error", System.Text.Encoding.UTF8, "text/plain");
|
||||
return response;
|
||||
if(Debugger.IsAttached) throw;
|
||||
#endif
|
||||
response.Content = new StringContent("error", Encoding.UTF8, "text/plain");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
@@ -158,9 +159,7 @@ namespace DiscImageChef.Server.Controllers
|
||||
{
|
||||
addNvs = new OsStats
|
||||
{
|
||||
name = oldNvs.name,
|
||||
Value = oldNvs.Value + 1,
|
||||
version = oldNvs.version
|
||||
name = oldNvs.name, Value = oldNvs.Value + 1, version = oldNvs.version
|
||||
};
|
||||
removeNvs = oldNvs;
|
||||
break;
|
||||
@@ -189,8 +188,7 @@ namespace DiscImageChef.Server.Controllers
|
||||
{
|
||||
addNvs = new NameValueStats
|
||||
{
|
||||
name = oldNvs.name,
|
||||
Value = oldNvs.Value + newNvs.Value
|
||||
name = oldNvs.name, Value = oldNvs.Value + newNvs.Value
|
||||
};
|
||||
removeNvs = oldNvs;
|
||||
break;
|
||||
@@ -243,8 +241,7 @@ namespace DiscImageChef.Server.Controllers
|
||||
{
|
||||
addNvs = new NameValueStats
|
||||
{
|
||||
name = oldNvs.name,
|
||||
Value = oldNvs.Value + newNvs.Value
|
||||
name = oldNvs.name, Value = oldNvs.Value + newNvs.Value
|
||||
};
|
||||
removeNvs = oldNvs;
|
||||
break;
|
||||
@@ -272,8 +269,7 @@ namespace DiscImageChef.Server.Controllers
|
||||
{
|
||||
addNvs = new NameValueStats
|
||||
{
|
||||
name = oldNvs.name,
|
||||
Value = oldNvs.Value + newNvs.Value
|
||||
name = oldNvs.name, Value = oldNvs.Value + newNvs.Value
|
||||
};
|
||||
removeNvs = oldNvs;
|
||||
break;
|
||||
@@ -301,8 +297,7 @@ namespace DiscImageChef.Server.Controllers
|
||||
{
|
||||
addNvs = new NameValueStats
|
||||
{
|
||||
name = oldNvs.name,
|
||||
Value = oldNvs.Value + newNvs.Value
|
||||
name = oldNvs.name, Value = oldNvs.Value + newNvs.Value
|
||||
};
|
||||
removeNvs = oldNvs;
|
||||
break;
|
||||
@@ -330,8 +325,7 @@ namespace DiscImageChef.Server.Controllers
|
||||
{
|
||||
addNvs = new NameValueStats
|
||||
{
|
||||
name = oldNvs.name,
|
||||
Value = oldNvs.Value + newNvs.Value
|
||||
name = oldNvs.name, Value = oldNvs.Value + newNvs.Value
|
||||
};
|
||||
removeNvs = oldNvs;
|
||||
break;
|
||||
@@ -469,12 +463,10 @@ namespace DiscImageChef.Server.Controllers
|
||||
catch(Exception ex)
|
||||
{
|
||||
#if DEBUG
|
||||
System.Console.WriteLine("{0} {1}", ex.Message, ex.InnerException);
|
||||
throw;
|
||||
#else
|
||||
response.Content = new StringContent("error", System.Text.Encoding.UTF8, "text/plain");
|
||||
return response;
|
||||
if(Debugger.IsAttached) throw;
|
||||
#endif
|
||||
response.Content = new StringContent("error", Encoding.UTF8, "text/plain");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user