diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-04-27 14:11:56 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-04-27 14:11:56 -0400 |
| commit | ffb935700cc2d9ac47a81e43cf2187ff8c78957a (patch) | |
| tree | bf3d2d82b5d4637b8c1b78699634c0d7b12cff62 | |
| parent | f13696868fd87924441a732e703350b56ae6ad7b (diff) | |
update mono unhandled exception handler
| -rw-r--r-- | Emby.Server.Implementations/Logging/UnhandledExceptionWriter.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Server.Mono/Program.cs | 7 | ||||
| -rw-r--r-- | MediaBrowser.Server.Mono/app.config | 2 |
3 files changed, 12 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Logging/UnhandledExceptionWriter.cs b/Emby.Server.Implementations/Logging/UnhandledExceptionWriter.cs index 5183f3a0b..6e96d83fd 100644 --- a/Emby.Server.Implementations/Logging/UnhandledExceptionWriter.cs +++ b/Emby.Server.Implementations/Logging/UnhandledExceptionWriter.cs @@ -35,9 +35,11 @@ namespace Emby.Server.Implementations.Logging // Write to console just in case file logging fails _console.WriteLine("UnhandledException"); - _console.WriteLine(builder.ToString()); - _fileSystem.WriteAllText(path, builder.ToString()); + var logMessage = builder.ToString(); + _console.WriteLine(logMessage); + + _fileSystem.WriteAllText(path, logMessage); } } } diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs index 66851f7e9..dcd2dcaa6 100644 --- a/MediaBrowser.Server.Mono/Program.cs +++ b/MediaBrowser.Server.Mono/Program.cs @@ -258,7 +258,12 @@ namespace MediaBrowser.Server.Mono if (!Debugger.IsAttached) { - Environment.Exit(System.Runtime.InteropServices.Marshal.GetHRForException(exception)); + var message = LogHelper.GetLogMessage(exception).ToString(); + + if (message.IndexOf("InotifyWatcher", StringComparison.OrdinalIgnoreCase) == -1) + { + Environment.Exit(System.Runtime.InteropServices.Marshal.GetHRForException(exception)); + } } } diff --git a/MediaBrowser.Server.Mono/app.config b/MediaBrowser.Server.Mono/app.config index 07c113f3e..8f21d4a67 100644 --- a/MediaBrowser.Server.Mono/app.config +++ b/MediaBrowser.Server.Mono/app.config @@ -11,6 +11,8 @@ <add key="ReleaseProgramDataPath" value="ProgramData-Server" /> </appSettings> <runtime> + <legacyUnhandledExceptionPolicy enabled="1" /> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" /> |
