nixpkgs/pkgs/by-name/to/torrentstream/0001-display-the-message-of-caught-exceptions.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
1.4 KiB
Diff
Raw Normal View History

2023-10-17 01:27:26 +02:00
diff --git a/Program.cs b/Program.cs
index 5697d79..7cfba20 100644
--- a/Program.cs
+++ b/Program.cs
@@ -79,6 +79,8 @@ app.MapGet ( "/proxyvideolist", ProxyHandler.ProxyVideolist );
app.MapGet ( "/proxyvideopart", ProxyHandler.ProxyVideoPart );
app.MapGet ( "/playerws", ExternalPlayer.ExternalWebSocket );
+Console.WriteLine ($"BaseFolder: {GlobalConfiguration.BaseFolder}");
+
await TorrentHandler.LoadState ();
app.Run ();
diff --git a/StreamHandler.cs b/StreamHandler.cs
index 43aa61c..7d26681 100644
--- a/StreamHandler.cs
+++ b/StreamHandler.cs
@@ -110,7 +110,8 @@ namespace TorrentStream {
context.Response.StatusCode = 302;
context.Response.Headers.Location = ( RuntimeInformation.IsOSPlatform ( OSPlatform.Windows ) ? "file:///" : "file://" ) + currentFile.FullPath;
}
- } catch {
+ } catch (Exception e) {
+ Console.WriteLine($"Exception caught: {e.Message}");
context.Response.StatusCode = 500;
}
}
@@ -192,7 +193,8 @@ namespace TorrentStream {
}
context.Response.StatusCode = 200;
await context.Response.WriteAsync ( "Downloading started" );
- } catch {
+ } catch (Exception e) {
+ Console.WriteLine($"Exception caught: {e.Message}");
context.Response.StatusCode = 500;
}
}