mastodon: 4.3.1 -> 4.3.2 (#361487)
[NixPkgs.git] / pkgs / by-name / to / torrentstream / 0001-display-the-message-of-caught-exceptions.patch
blob3e21bb0530bdf9db7328f25cdc136a67ffd369c8
1 diff --git a/Program.cs b/Program.cs
2 index 5697d79..7cfba20 100644
3 --- a/Program.cs
4 +++ b/Program.cs
5 @@ -79,6 +79,8 @@ app.MapGet ( "/proxyvideolist", ProxyHandler.ProxyVideolist );
6 app.MapGet ( "/proxyvideopart", ProxyHandler.ProxyVideoPart );
7 app.MapGet ( "/playerws", ExternalPlayer.ExternalWebSocket );
9 +Console.WriteLine ($"BaseFolder: {GlobalConfiguration.BaseFolder}");
11 await TorrentHandler.LoadState ();
13 app.Run ();
14 diff --git a/StreamHandler.cs b/StreamHandler.cs
15 index 43aa61c..7d26681 100644
16 --- a/StreamHandler.cs
17 +++ b/StreamHandler.cs
18 @@ -110,7 +110,8 @@ namespace TorrentStream {
19 context.Response.StatusCode = 302;
20 context.Response.Headers.Location = ( RuntimeInformation.IsOSPlatform ( OSPlatform.Windows ) ? "file:///" : "file://" ) + currentFile.FullPath;
22 - } catch {
23 + } catch (Exception e) {
24 + Console.WriteLine($"Exception caught: {e.Message}");
25 context.Response.StatusCode = 500;
28 @@ -192,7 +193,8 @@ namespace TorrentStream {
30 context.Response.StatusCode = 200;
31 await context.Response.WriteAsync ( "Downloading started" );
32 - } catch {
33 + } catch (Exception e) {
34 + Console.WriteLine($"Exception caught: {e.Message}");
35 context.Response.StatusCode = 500;