Why is this code causing Visual Studio to break if it is being ran in a try catch?
It takes me here and shows me this exception:
System.Net.Http.HttpRequestException: 'The proxy tunnel request to proxy '' failed with status code '502'."'C:\Users\FRZ\AppData\Local\SourceServer\89eb5aeb9b5e4245c273d7fede24aa2abe75483baa9ebc06da5a3ca0b1aba702\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs[DebuggerBrowsable(DebuggerBrowsableState.Never)] // prevent debugger evaluation from invalidating an underling IValueTaskSource<T> public TResult Result { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { object? obj = _obj; Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); if (obj == null) { return _result!; } if (obj is Task<TResult> t) { TaskAwaiter.ValidateEnd(t); return t.ResultOnSuccess; } return Unsafe.As<IValueTaskSource<TResult>>(obj).GetResult(_token); } }
System.Net.Http.HttpRequestException: 'The proxy tunnel request to proxy '' failed with status code '502'."'C:\Users\FRZ\AppData\Local\SourceServer\89eb5aeb9b5e4245c273d7fede24aa2abe75483baa9ebc06da5a3ca0b1aba702\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs[DebuggerBrowsable(DebuggerBrowsableState.Never)] // prevent debugger evaluation from invalidating an underling IValueTaskSource<T> public TResult Result { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { object? obj = _obj; Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); if (obj == null) { return _result!; } if (obj is Task<TResult> t) { TaskAwaiter.ValidateEnd(t); return t.ResultOnSuccess; } return Unsafe.As<IValueTaskSource<TResult>>(obj).GetResult(_token); } }
public static async Task<string?> GetShopHtml(string shopUrl) { using var httpReq = new HttpRequestMessage(HttpMethod.Get, shopUrl); HttpResponseMessage httpResp = await Client.SendAsync(httpReq);
public static async Task<string?> GetShopHtml(string shopUrl) { using var httpReq = new HttpRequestMessage(HttpMethod.Get, shopUrl); HttpResponseMessage httpResp = await Client.SendAsync(httpReq);