added ExceptronIgnoreOnMono and ExceptronIgnore extention methods.
This commit is contained in:
parent
02fab62811
commit
7b2e3ef0c4
|
@ -1,89 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
|
||||||
<ProductVersion>8.0.30703</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectGuid>{B1784698-592E-4132-BDFA-9817409E3A96}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Exceptron.Client</RootNamespace>
|
|
||||||
<AssemblyName>Exceptron.Client</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
<TargetFrameworkProfile />
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>false</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<OutputPath>..\..\_output\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
|
||||||
<OutputPath>..\..\_output\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Configuration" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Web" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="Configuration\ExceptronConfiguration.cs" />
|
|
||||||
<Compile Include="ExceptionData.cs" />
|
|
||||||
<Compile Include="ExceptronClient.cs" />
|
|
||||||
<Compile Include="ExceptronApiException.cs" />
|
|
||||||
<Compile Include="IExceptronClient.cs" />
|
|
||||||
<Compile Include="Message\ExceptionResponse.cs" />
|
|
||||||
<Compile Include="ExceptionSeverity.cs" />
|
|
||||||
<Compile Include="IRestClient.cs" />
|
|
||||||
<Compile Include="Message\ExceptionReport.cs" />
|
|
||||||
<Compile Include="fastJSON\Getters.cs" />
|
|
||||||
<Compile Include="fastJSON\JSON.cs" />
|
|
||||||
<Compile Include="fastJSON\JsonParser.cs" />
|
|
||||||
<Compile Include="fastJSON\JsonSerializer.cs" />
|
|
||||||
<Compile Include="fastJSON\SafeDictionary.cs" />
|
|
||||||
<Compile Include="Message\Frame.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="RestClient.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="NuGet\web.config.transform">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</None>
|
|
||||||
<None Include="Exceptron.Client.nuspec">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</None>
|
|
||||||
<None Include="fastJSON\license.txt" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup />
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,20 +0,0 @@
|
||||||
<?xml version="1.0"?>
|
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
|
||||||
<metadata>
|
|
||||||
<id>$id$</id>
|
|
||||||
<version>$version$</version>
|
|
||||||
<title>$id$</title>
|
|
||||||
<authors>$author$</authors>
|
|
||||||
<owners>$author$</owners>
|
|
||||||
<projectUrl>https://github.com/Exceptron/Exceptron.Net</projectUrl>
|
|
||||||
<iconUrl>https://www.exceptron.com/logos/Exceptron128.png</iconUrl>
|
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
|
||||||
<description>Exceptron.Client is a .NET wrapper for exceptron's REST API. exceptron help you report your application error to a central location for review, reporting and analytics.</description>
|
|
||||||
<language>en-US</language>
|
|
||||||
<copyright>Copyright © 2012</copyright>
|
|
||||||
<tags>Exception Logging Analytics Reporting Exceptron</tags>
|
|
||||||
</metadata>
|
|
||||||
<files>
|
|
||||||
<file src="NuGet\web.config.transform" target="content" />
|
|
||||||
</files>
|
|
||||||
</package>
|
|
|
@ -1,7 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<configuration>
|
|
||||||
<configSections>
|
|
||||||
<section name="exceptron" type="Exceptron.Client.Configuration.ExceptronConfiguration,Exceptron.Client" />
|
|
||||||
</configSections>
|
|
||||||
<exceptron apiKey="YOUR_EXCEPTRON_API_KEY" throwExceptions="true" includeMachineName="true"/>
|
|
||||||
</configuration>
|
|
|
@ -1,30 +0,0 @@
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("Exceptron.Client")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyDescription(".NET client for exceptron API. In-cloud exception aggregation and analytics.")]
|
|
||||||
[assembly: AssemblyCompany("Exceptron Solutions Inc.")]
|
|
||||||
[assembly: AssemblyProduct("Exceptron.Client")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © 2012")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("a463887e-594f-4733-b227-a79f4ffb2158")]
|
|
||||||
|
|
||||||
[assembly: AssemblyVersion("10.0.0.*")]
|
|
||||||
|
|
||||||
[assembly: InternalsVisibleTo("Exceptron.Client.Tests")]
|
|
||||||
[assembly: InternalsVisibleTo("Exceptron.Api.v1.Tests")]
|
|
||||||
[assembly: InternalsVisibleTo("Exceptron.Rush")]
|
|
||||||
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
|
|
|
@ -1,8 +1,8 @@
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using Exceptron.Client.Message;
|
using NzbDrone.Common.Exceptron.Message;
|
||||||
|
|
||||||
namespace Exceptron.Client.Configuration
|
namespace NzbDrone.Common.Exceptron.Configuration
|
||||||
{
|
{
|
||||||
|
|
||||||
public class ExceptronConfiguration : ConfigurationSection
|
public class ExceptronConfiguration : ConfigurationSection
|
|
@ -1,7 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Exceptron.Client
|
namespace NzbDrone.Common.Exceptron
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents information that will be used to construct an exception report.
|
/// Represents information that will be used to construct an exception report.
|
||||||
|
@ -51,12 +50,6 @@ namespace Exceptron.Client
|
||||||
/// Severity of the exception being reported
|
/// Severity of the exception being reported
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ExceptionSeverity Severity { get; set; }
|
public ExceptionSeverity Severity { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// <see cref="System.Web.HttpContext"/> that triggered this exception. If no <see cref="System.Web.HttpContext"/> is provided
|
|
||||||
/// <see cref="ExceptronClient"/> will try to get the current <see cref="System.Web.HttpContext"/> from <see cref="System.Web.HttpContext.Current"/>
|
|
||||||
/// </summary>
|
|
||||||
public HttpContext HttpContext { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Exceptron.Client
|
namespace NzbDrone.Common.Exceptron
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Severity of the exception being reported
|
/// Severity of the exception being reported
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
|
||||||
namespace Exceptron.Client
|
namespace NzbDrone.Common.Exceptron
|
||||||
{
|
{
|
||||||
public class ExceptronApiException : Exception
|
public class ExceptronApiException : Exception
|
||||||
{
|
{
|
|
@ -3,12 +3,39 @@ using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Web;
|
using NzbDrone.Common.EnvironmentInfo;
|
||||||
using Exceptron.Client.Configuration;
|
using NzbDrone.Common.Exceptron.Configuration;
|
||||||
using Exceptron.Client.Message;
|
using NzbDrone.Common.Exceptron.Message;
|
||||||
|
|
||||||
namespace Exceptron.Client
|
namespace NzbDrone.Common.Exceptron
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public static class ExceptionExtentions
|
||||||
|
{
|
||||||
|
private const string IgnoreFlag = "exceptron_ignore";
|
||||||
|
|
||||||
|
public static Exception ExceptronIgnoreOnMono(this Exception exception)
|
||||||
|
{
|
||||||
|
if (OsInfo.IsMono)
|
||||||
|
{
|
||||||
|
exception.ExceptronIgnore();
|
||||||
|
}
|
||||||
|
|
||||||
|
return exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Exception ExceptronIgnore(this Exception exception)
|
||||||
|
{
|
||||||
|
exception.Data.Add(IgnoreFlag, true);
|
||||||
|
return exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool ExceptronShouldIgnore(this Exception exception)
|
||||||
|
{
|
||||||
|
return exception.Data.Contains(IgnoreFlag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class ExceptronClient : IExceptronClient
|
public class ExceptronClient : IExceptronClient
|
||||||
{
|
{
|
||||||
internal IRestClient RestClient { private get; set; }
|
internal IRestClient RestClient { private get; set; }
|
||||||
|
@ -103,7 +130,7 @@ namespace Exceptron.Client
|
||||||
/// <param name="httpContext"><see cref="System.Web.HttpContext"/> in which the exception occurred. If no <see cref="System.Web.HttpContext"/> is provided
|
/// <param name="httpContext"><see cref="System.Web.HttpContext"/> in which the exception occurred. If no <see cref="System.Web.HttpContext"/> is provided
|
||||||
/// <see cref="ExceptronClient"/> will try to get the current <see cref="System.Web.HttpContext"/> from <see cref="System.Web.HttpContext.Current"/></param>
|
/// <see cref="ExceptronClient"/> will try to get the current <see cref="System.Web.HttpContext"/> from <see cref="System.Web.HttpContext.Current"/></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public ExceptionResponse SubmitException(Exception exception, string component, ExceptionSeverity severity = ExceptionSeverity.None, string message = null, string userId = null, HttpContext httpContext = null)
|
public ExceptionResponse SubmitException(Exception exception, string component, ExceptionSeverity severity = ExceptionSeverity.None, string message = null, string userId = null)
|
||||||
{
|
{
|
||||||
var exceptionData = new ExceptionData
|
var exceptionData = new ExceptionData
|
||||||
{
|
{
|
||||||
|
@ -111,8 +138,7 @@ namespace Exceptron.Client
|
||||||
Component = component,
|
Component = component,
|
||||||
Severity = severity,
|
Severity = severity,
|
||||||
Message = message,
|
Message = message,
|
||||||
UserId = userId,
|
UserId = userId
|
||||||
HttpContext = httpContext
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return SubmitException(exceptionData);
|
return SubmitException(exceptionData);
|
||||||
|
@ -146,7 +172,6 @@ namespace Exceptron.Client
|
||||||
report.fv = _maxFrameworkVersion;
|
report.fv = _maxFrameworkVersion;
|
||||||
report.ft = FrameworkType;
|
report.ft = FrameworkType;
|
||||||
|
|
||||||
SetHttpInfo(exceptionData, report);
|
|
||||||
SetEnviromentInfo(report);
|
SetEnviromentInfo(report);
|
||||||
|
|
||||||
var exceptionResponse = RestClient.Put<ExceptionResponse>(Configuration.Host, report);
|
var exceptionResponse = RestClient.Put<ExceptionResponse>(Configuration.Host, report);
|
||||||
|
@ -209,37 +234,7 @@ namespace Exceptron.Client
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetHttpInfo(ExceptionData exceptionData, ExceptionReport report)
|
|
||||||
{
|
|
||||||
if (exceptionData.HttpContext == null && HttpContext.Current == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (exceptionData.HttpContext == null)
|
|
||||||
{
|
|
||||||
exceptionData.HttpContext = HttpContext.Current;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
report.hm = exceptionData.HttpContext.Request.HttpMethod;
|
|
||||||
|
|
||||||
//TODO:find proper way to find http status code.
|
|
||||||
/*
|
|
||||||
var httpException = exceptionData.Exception as HttpException;
|
|
||||||
if (httpException != null)
|
|
||||||
{
|
|
||||||
report.sc = httpException.GetHttpCode();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
report.url = exceptionData.HttpContext.Request.Url.ToString();
|
|
||||||
report.ua = exceptionData.HttpContext.Request.UserAgent;
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
if (Configuration.ThrowExceptions) throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static List<Frame> ConvertToFrames(Exception exception)
|
internal static List<Frame> ConvertToFrames(Exception exception)
|
||||||
{
|
{
|
|
@ -1,9 +1,8 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Web;
|
using NzbDrone.Common.Exceptron.Configuration;
|
||||||
using Exceptron.Client.Configuration;
|
using NzbDrone.Common.Exceptron.Message;
|
||||||
using Exceptron.Client.Message;
|
|
||||||
|
|
||||||
namespace Exceptron.Client
|
namespace NzbDrone.Common.Exceptron
|
||||||
{
|
{
|
||||||
public interface IExceptronClient
|
public interface IExceptronClient
|
||||||
{
|
{
|
||||||
|
@ -40,6 +39,6 @@ namespace Exceptron.Client
|
||||||
/// <param name="httpContext"><see cref="System.Web.HttpContext"/> in which the exception occurred. If no <see cref="System.Web.HttpContext"/> is provided
|
/// <param name="httpContext"><see cref="System.Web.HttpContext"/> in which the exception occurred. If no <see cref="System.Web.HttpContext"/> is provided
|
||||||
/// <see cref="ExceptronClient"/> will try to get the current <see cref="System.Web.HttpContext"/> from <see cref="System.Web.HttpContext.Current"/></param>
|
/// <see cref="ExceptronClient"/> will try to get the current <see cref="System.Web.HttpContext"/> from <see cref="System.Web.HttpContext.Current"/></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
ExceptionResponse SubmitException(Exception exception, string component, ExceptionSeverity severity = ExceptionSeverity.None, string message = null, string userId = null, HttpContext httpContext = null);
|
ExceptionResponse SubmitException(Exception exception, string component, ExceptionSeverity severity = ExceptionSeverity.None, string message = null, string userId = null);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Exceptron.Client
|
namespace NzbDrone.Common.Exceptron
|
||||||
{
|
{
|
||||||
internal interface IRestClient
|
internal interface IRestClient
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Exceptron.Client.Message
|
namespace NzbDrone.Common.Exceptron.Message
|
||||||
{
|
{
|
||||||
internal class ExceptionReport
|
internal class ExceptionReport
|
||||||
{
|
{
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using Exceptron.Client.Configuration;
|
using NzbDrone.Common.Exceptron.Configuration;
|
||||||
|
|
||||||
namespace Exceptron.Client.Message
|
namespace NzbDrone.Common.Exceptron.Message
|
||||||
{
|
{
|
||||||
public class ExceptionResponse
|
public class ExceptionResponse
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Exceptron.Client.Message
|
namespace NzbDrone.Common.Exceptron.Message
|
||||||
{
|
{
|
||||||
internal class Frame
|
internal class Frame
|
||||||
{
|
{
|
|
@ -3,9 +3,9 @@ using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Exceptron.Client.fastJSON;
|
using NzbDrone.Common.Exceptron.fastJSON;
|
||||||
|
|
||||||
namespace Exceptron.Client
|
namespace NzbDrone.Common.Exceptron
|
||||||
{
|
{
|
||||||
public sealed class RestClient : IRestClient
|
public sealed class RestClient : IRestClient
|
||||||
{
|
{
|
|
@ -4,7 +4,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Exceptron.Client.fastJSON
|
namespace NzbDrone.Common.Exceptron.fastJSON
|
||||||
{
|
{
|
||||||
internal class Getters
|
internal class Getters
|
||||||
{
|
{
|
|
@ -11,7 +11,7 @@ using System.Reflection;
|
||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace Exceptron.Client.fastJSON
|
namespace NzbDrone.Common.Exceptron.fastJSON
|
||||||
{
|
{
|
||||||
|
|
||||||
internal class JSON
|
internal class JSON
|
|
@ -6,7 +6,7 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Exceptron.Client.fastJSON
|
namespace NzbDrone.Common.Exceptron.fastJSON
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This class encodes and decodes JSON strings.
|
/// This class encodes and decodes JSON strings.
|
|
@ -9,7 +9,7 @@ using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Exceptron.Client.fastJSON
|
namespace NzbDrone.Common.Exceptron.fastJSON
|
||||||
{
|
{
|
||||||
internal class JSONSerializer
|
internal class JSONSerializer
|
||||||
{
|
{
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Exceptron.Client.fastJSON
|
namespace NzbDrone.Common.Exceptron.fastJSON
|
||||||
{
|
{
|
||||||
internal class SafeDictionary<TKey, TValue>
|
internal class SafeDictionary<TKey, TValue>
|
||||||
{
|
{
|
|
@ -1,12 +1,11 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
|
||||||
using Exceptron.Client;
|
|
||||||
using Exceptron.Client.Configuration;
|
|
||||||
using NLog;
|
using NLog;
|
||||||
using NLog.Common;
|
using NLog.Common;
|
||||||
using NLog.Layouts;
|
using NLog.Layouts;
|
||||||
using NLog.Targets;
|
using NLog.Targets;
|
||||||
using NzbDrone.Common.EnvironmentInfo;
|
using NzbDrone.Common.EnvironmentInfo;
|
||||||
|
using NzbDrone.Common.Exceptron;
|
||||||
|
using NzbDrone.Common.Exceptron.Configuration;
|
||||||
|
|
||||||
namespace NzbDrone.Common.Instrumentation
|
namespace NzbDrone.Common.Instrumentation
|
||||||
{
|
{
|
||||||
|
@ -46,9 +45,7 @@ namespace NzbDrone.Common.Instrumentation
|
||||||
|
|
||||||
protected override void Write(LogEventInfo logEvent)
|
protected override void Write(LogEventInfo logEvent)
|
||||||
{
|
{
|
||||||
if (logEvent == null || logEvent.Exception == null) return;
|
if (logEvent == null || logEvent.Exception == null || logEvent.Exception.ExceptronShouldIgnore()) return;
|
||||||
|
|
||||||
InternalLogger.Debug("Sending Exception to api.exceptron.com. Process Name: {0}", Process.GetCurrentProcess().ProcessName);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
<Reference Include="System.Configuration.Install" />
|
<Reference Include="System.Configuration.Install" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.ServiceProcess" />
|
<Reference Include="System.ServiceProcess" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="ICSharpCode.SharpZipLib">
|
<Reference Include="ICSharpCode.SharpZipLib">
|
||||||
|
@ -55,6 +56,7 @@
|
||||||
<Reference Include="NLog">
|
<Reference Include="NLog">
|
||||||
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="ArchiveService.cs" />
|
<Compile Include="ArchiveService.cs" />
|
||||||
|
@ -99,6 +101,22 @@
|
||||||
<Compile Include="EnvironmentInfo\StartupContext.cs" />
|
<Compile Include="EnvironmentInfo\StartupContext.cs" />
|
||||||
<Compile Include="Exceptions\NotParentException.cs" />
|
<Compile Include="Exceptions\NotParentException.cs" />
|
||||||
<Compile Include="Exceptions\NzbDroneException.cs" />
|
<Compile Include="Exceptions\NzbDroneException.cs" />
|
||||||
|
<Compile Include="Exceptron\Configuration\ExceptronConfiguration.cs" />
|
||||||
|
<Compile Include="Exceptron\ExceptionData.cs" />
|
||||||
|
<Compile Include="Exceptron\ExceptionSeverity.cs" />
|
||||||
|
<Compile Include="Exceptron\ExceptronApiException.cs" />
|
||||||
|
<Compile Include="Exceptron\ExceptronClient.cs" />
|
||||||
|
<Compile Include="Exceptron\fastJSON\Getters.cs" />
|
||||||
|
<Compile Include="Exceptron\fastJSON\JSON.cs" />
|
||||||
|
<Compile Include="Exceptron\fastJSON\JsonParser.cs" />
|
||||||
|
<Compile Include="Exceptron\fastJSON\JsonSerializer.cs" />
|
||||||
|
<Compile Include="Exceptron\fastJSON\SafeDictionary.cs" />
|
||||||
|
<Compile Include="Exceptron\IExceptronClient.cs" />
|
||||||
|
<Compile Include="Exceptron\IRestClient.cs" />
|
||||||
|
<Compile Include="Exceptron\Message\ExceptionReport.cs" />
|
||||||
|
<Compile Include="Exceptron\Message\ExceptionResponse.cs" />
|
||||||
|
<Compile Include="Exceptron\Message\Frame.cs" />
|
||||||
|
<Compile Include="Exceptron\RestClient.cs" />
|
||||||
<Compile Include="Expansive\CircularReferenceException.cs" />
|
<Compile Include="Expansive\CircularReferenceException.cs" />
|
||||||
<Compile Include="Expansive\Expansive.cs" />
|
<Compile Include="Expansive\Expansive.cs" />
|
||||||
<Compile Include="Expansive\PatternStyle.cs" />
|
<Compile Include="Expansive\PatternStyle.cs" />
|
||||||
|
@ -170,14 +188,9 @@
|
||||||
<EmbeddedResource Include="EnsureThat\Resources\ExceptionMessages.resx" />
|
<EmbeddedResource Include="EnsureThat\Resources\ExceptionMessages.resx" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Include="Exceptron\fastJSON\license.txt" />
|
||||||
<Content Include="Expansive\license.txt" />
|
<Content Include="Expansive\license.txt" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Exceptron.Client\Exceptron.Client.csproj">
|
|
||||||
<Project>{B1784698-592E-4132-BDFA-9817409E3A96}</Project>
|
|
||||||
<Name>Exceptron.Client</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup />
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||||
|
|
|
@ -25,12 +25,13 @@ namespace NzbDrone.Console
|
||||||
Logger.FatalException("EPIC FAIL!", e);
|
Logger.FatalException("EPIC FAIL!", e);
|
||||||
System.Console.WriteLine("Press any key to exit...");
|
System.Console.WriteLine("Press any key to exit...");
|
||||||
System.Console.ReadLine();
|
System.Console.ReadLine();
|
||||||
|
|
||||||
//Need this to terminate on mono (thanks nlog)
|
|
||||||
LogManager.Configuration = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.Info("Exiting main.");
|
Logger.Info("Exiting main.");
|
||||||
|
|
||||||
|
//Need this to terminate on mono (thanks nlog)
|
||||||
|
LogManager.Configuration = null;
|
||||||
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ namespace NzbDrone.Host
|
||||||
_container.Resolve<IWaitForExit>().Spin();
|
_container.Resolve<IWaitForExit>().Spin();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void EnsureSingleInstance(bool isService, StartupContext startupContext)
|
private static void EnsureSingleInstance(bool isService, IStartupContext startupContext)
|
||||||
{
|
{
|
||||||
var instancePolicy = _container.Resolve<ISingleInstancePolicy>();
|
var instancePolicy = _container.Resolve<ISingleInstancePolicy>();
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ namespace NzbDrone.Host
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ApplicationModes GetApplicationMode(StartupContext startupContext)
|
private static ApplicationModes GetApplicationMode(IStartupContext startupContext)
|
||||||
{
|
{
|
||||||
if (startupContext.Flags.Contains(StartupContext.HELP))
|
if (startupContext.Flags.Contains(StartupContext.HELP))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 2012
|
# Visual Studio 2013
|
||||||
|
VisualStudioVersion = 12.0.30723.0
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{57A04B72-8088-4F75-A582-1158CF8291F7}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{57A04B72-8088-4F75-A582-1158CF8291F7}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test.Common", "Test.Common", "{47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test.Common", "Test.Common", "{47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97}"
|
||||||
|
@ -44,8 +46,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{1E6B3C
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NzbDrone.Api", "NzbDrone.Api\NzbDrone.Api.csproj", "{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NzbDrone.Api", "NzbDrone.Api\NzbDrone.Api.csproj", "{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exceptron.Client", "Exceptron.Client\Exceptron.Client.csproj", "{B1784698-592E-4132-BDFA-9817409E3A96}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Host", "Host", "{486ADF86-DD89-4E19-B805-9D94F19800D9}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Host", "Host", "{486ADF86-DD89-4E19-B805-9D94F19800D9}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NzbDrone.Console", "NzbDrone.Console\NzbDrone.Console.csproj", "{3DCA7B58-B8B3-49AC-9D9E-56F4A0460976}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NzbDrone.Console", "NzbDrone.Console\NzbDrone.Console.csproj", "{3DCA7B58-B8B3-49AC-9D9E-56F4A0460976}"
|
||||||
|
@ -313,21 +313,6 @@ Global
|
||||||
{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Release|Mixed Platforms.Build.0 = Release|x86
|
{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||||
{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Release|x86.ActiveCfg = Release|x86
|
{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Release|x86.ActiveCfg = Release|x86
|
||||||
{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Release|x86.Build.0 = Release|x86
|
{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Release|x86.Build.0 = Release|x86
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Debug|Any CPU.ActiveCfg = Debug|x86
|
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Debug|x86.ActiveCfg = Debug|x86
|
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Debug|x86.Build.0 = Debug|x86
|
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Mono|Any CPU.ActiveCfg = Release|x86
|
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Mono|Mixed Platforms.ActiveCfg = Release|x86
|
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Mono|Mixed Platforms.Build.0 = Release|x86
|
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Mono|x86.ActiveCfg = Debug|x86
|
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Mono|x86.Build.0 = Debug|x86
|
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Release|Any CPU.ActiveCfg = Release|x86
|
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Release|Mixed Platforms.Build.0 = Release|x86
|
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Release|x86.ActiveCfg = Release|x86
|
|
||||||
{B1784698-592E-4132-BDFA-9817409E3A96}.Release|x86.Build.0 = Release|x86
|
|
||||||
{3DCA7B58-B8B3-49AC-9D9E-56F4A0460976}.Debug|Any CPU.ActiveCfg = Debug|x86
|
{3DCA7B58-B8B3-49AC-9D9E-56F4A0460976}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||||
{3DCA7B58-B8B3-49AC-9D9E-56F4A0460976}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
{3DCA7B58-B8B3-49AC-9D9E-56F4A0460976}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||||
{3DCA7B58-B8B3-49AC-9D9E-56F4A0460976}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
{3DCA7B58-B8B3-49AC-9D9E-56F4A0460976}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||||
|
@ -491,6 +476,8 @@ Global
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(NestedProjects) = preSolution
|
GlobalSection(NestedProjects) = preSolution
|
||||||
{47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
{47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
||||||
|
{FAFB5948-A222-4CF6-AD14-026BE7564802} = {47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97}
|
||||||
|
{CADDFCE0-7509-4430-8364-2074E1EEFCA2} = {47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97}
|
||||||
{193ADD3B-792B-4173-8E4C-5A3F8F0237F0} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
{193ADD3B-792B-4173-8E4C-5A3F8F0237F0} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
||||||
{C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
{C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
||||||
{35388E8E-0CDB-4A84-AD16-E4B6EFDA5D97} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
{35388E8E-0CDB-4A84-AD16-E4B6EFDA5D97} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
||||||
|
@ -499,9 +486,6 @@ Global
|
||||||
{CBF6B8B0-A015-413A-8C86-01238BB45770} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
{CBF6B8B0-A015-413A-8C86-01238BB45770} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
||||||
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
||||||
{CC26800D-F67E-464B-88DE-8EB1A0C227A3} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
{CC26800D-F67E-464B-88DE-8EB1A0C227A3} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
||||||
{4EACDBBC-BCD7-4765-A57B-3E08331E4749} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
|
||||||
{FAFB5948-A222-4CF6-AD14-026BE7564802} = {47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97}
|
|
||||||
{CADDFCE0-7509-4430-8364-2074E1EEFCA2} = {47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97}
|
|
||||||
{6BCE712F-846D-4846-9D1B-A66B858DA755} = {F9E67978-5CD6-4A5F-827B-4249711C0B02}
|
{6BCE712F-846D-4846-9D1B-A66B858DA755} = {F9E67978-5CD6-4A5F-827B-4249711C0B02}
|
||||||
{700D0B95-95CD-43F3-B6C9-FAA0FC1358D4} = {F9E67978-5CD6-4A5F-827B-4249711C0B02}
|
{700D0B95-95CD-43F3-B6C9-FAA0FC1358D4} = {F9E67978-5CD6-4A5F-827B-4249711C0B02}
|
||||||
{3DCA7B58-B8B3-49AC-9D9E-56F4A0460976} = {486ADF86-DD89-4E19-B805-9D94F19800D9}
|
{3DCA7B58-B8B3-49AC-9D9E-56F4A0460976} = {486ADF86-DD89-4E19-B805-9D94F19800D9}
|
||||||
|
@ -510,8 +494,9 @@ Global
|
||||||
{1B9A82C4-BCA1-4834-A33E-226F17BE070B} = {F6E3A728-AE77-4D02-BAC8-82FBC1402DDA}
|
{1B9A82C4-BCA1-4834-A33E-226F17BE070B} = {F6E3A728-AE77-4D02-BAC8-82FBC1402DDA}
|
||||||
{2B8C6DAD-4D85-41B1-83FD-248D9F347522} = {F6E3A728-AE77-4D02-BAC8-82FBC1402DDA}
|
{2B8C6DAD-4D85-41B1-83FD-248D9F347522} = {F6E3A728-AE77-4D02-BAC8-82FBC1402DDA}
|
||||||
{F6FC6BE7-0847-4817-A1ED-223DC647C3D7} = {F6E3A728-AE77-4D02-BAC8-82FBC1402DDA}
|
{F6FC6BE7-0847-4817-A1ED-223DC647C3D7} = {F6E3A728-AE77-4D02-BAC8-82FBC1402DDA}
|
||||||
{911284D3-F130-459E-836C-2430B6FBF21D} = {0F0D4998-8F5D-4467-A909-BB192C4B3B4B}
|
|
||||||
{15AD7579-A314-4626-B556-663F51D97CD1} = {0F0D4998-8F5D-4467-A909-BB192C4B3B4B}
|
{15AD7579-A314-4626-B556-663F51D97CD1} = {0F0D4998-8F5D-4467-A909-BB192C4B3B4B}
|
||||||
|
{911284D3-F130-459E-836C-2430B6FBF21D} = {0F0D4998-8F5D-4467-A909-BB192C4B3B4B}
|
||||||
|
{4EACDBBC-BCD7-4765-A57B-3E08331E4749} = {57A04B72-8088-4F75-A582-1158CF8291F7}
|
||||||
{80B51429-7A0E-46D6-BEE3-C80DCB1C4EAA} = {4EACDBBC-BCD7-4765-A57B-3E08331E4749}
|
{80B51429-7A0E-46D6-BEE3-C80DCB1C4EAA} = {4EACDBBC-BCD7-4765-A57B-3E08331E4749}
|
||||||
{40D72824-7D02-4A77-9106-8FE0EEA2B997} = {4EACDBBC-BCD7-4765-A57B-3E08331E4749}
|
{40D72824-7D02-4A77-9106-8FE0EEA2B997} = {4EACDBBC-BCD7-4765-A57B-3E08331E4749}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
|
Loading…
Reference in New Issue