-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
Description
Feature Request
Provide more information when an exception occurs.
Current behavior
If an update fails scoop may print an error text in the form of:
scoop update imagemagick
imagemagick: 7.1.2-5 -> 7.1.2-7
Updating one outdated app:
Updating 'imagemagick' (7.1.2-5 -> 7.1.2-7)
Downloading new version
OperationStopped: C:\Users\philipp.kretzschmar\scoop\apps\scoop\current\lib\download.ps1:84
Line |
84 | throw $e
| ~~~~~~~~
| The SSL connection could not be established, see inner exception.
This isn't helpful as relevant context is completely omitted.
Wanted behavior
If I add to the download.ps1:
if ($e.innerexception) { $e = $e.innerexception }
Write-Host( $e.innerexception)
throw $e
Then I get a more helpful error message:
scoop update imagemagick
imagemagick: 7.1.2-5 -> 7.1.2-7
Updating one outdated app:
Updating 'imagemagick' (7.1.2-5 -> 7.1.2-7)
Downloading new version
System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
---> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at System.Net.Security.SslStream.ReceiveHandshakeFrameAsync[TIOAdapter](CancellationToken cancellationToken)
at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](Boolean receiveFirst, Byte[] reAuthenticationData, CancellationToken cancellationToken)
at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
OperationStopped: C:\Users\philipp.kretzschmar\scoop\apps\scoop\current\lib\download.ps1:85
Line |
85 | throw $e
| ~~~~~~~~
| The SSL connection could not be established, see inner exception.
This should apply too all exceptions that may hide relevant information to not hide why certain requests file, esp. if they are bound to happen through HTTP calls.
This would make debugging much easier.
This feature request was inspired by #6183 and thanks @xiaoxstz for pointing out that one can simply hack the file to get this information which I then did too.