Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap connection exceptions in HttpRequestException #7661

Merged
merged 5 commits into from
Jan 28, 2023

Conversation

grendello
Copy link
Contributor

Fixes: #7629

Whenever a Java backend connection fails for any reason, we wrap the
thrown exception in HttpRequestException as described in the
HttpClient.SendAsync documentation.

Fixes: dotnet#7629

Whenever a Java backend connection fails for any reason, we wrap the
thrown exception in `HttpRequestException` as described in the
`HttpClient.SendAsync` documentation.
@simonrozsival
Copy link
Member

Shouldn't we also fix the other WebExceptions that are thrown from AndroidMessageHandler? (for example https://github.com/xamarin/xamarin-android/blob/main/src/Mono.Android/Xamarin.Android.Net/AndroidMessageHandler.cs#L428-L436)

@grendello
Copy link
Contributor Author

@simonrozsival I don't want to touch these. We've had a lot of issues filed in the past regarding exception types, I don't want to revisit these unless I absolutely have to... :)

@simonrozsival
Copy link
Member

@grendello I see :) Let's not touch the other cases then.

Should the behavior change also for legacy Xamarin? There we throw the Java.IO.IOException if I'm not wrong (https://github.com/xamarin/xamarin-android/blob/main/tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidMessageHandlerTests.cs#L122-L126)

@grendello
Copy link
Contributor Author

@simonrozsival let's leave the legacy Xamarin as it is... :)

@grendello
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

* main: (32 commits)
  [monodroid] Replace `exit()` with `abort()` in native code (dotnet#7734)
  Bump to xamarin/Java.Interop/main@8a1ae57 (dotnet#7738)
  [build] bump `$(AndroidNet7Version)` (dotnet#7737)
  Bump to xamarin/Java.Interop/main@1366d99 (dotnet#7718)
  [Xamarin.Android.Build.Tasks] fix AndroidGenerateResourceDesigner (dotnet#7721)
  Bump to xamarin/monodroid@50faac94 (dotnet#7725)
  Revert "[Xamarin.Android.Build.Tasks] fix cases of missing `@(Reference)` (dotnet#7642)" (dotnet#7726)
  [marshal methods] Properly support arrays of arrays (dotnet#7707)
  Bump to dotnet/installer@9962c6a 8.0.100-alpha.1.23063.11 (dotnet#7677)
  [Actions] Add action to bump the hash used for the unified pipeline (dotnet#7712)
  Bump to xamarin/xamarin-android-tools/main@099fd95 (dotnet#7709)
  [ci] Move build stages into yaml templates (dotnet#7553)
  [Xamarin.Android.Build.Tasks] fix NRE in `<GenerateResourceCaseMap/>` (dotnet#7716)
  [ci] Pass token when building Designer tests (dotnet#7715)
  [Mono.Android] Android.Telecom.InCallService.SetAudioRoute() + enum (dotnet#7711)
  [Mono.Android] Fix some incorrect enums. (dotnet#7670)
  [Xamarin.Android.Build.Tasks] _Microsoft.Android.Resource.Designer namespace (dotnet#7681)
  LEGO: Merge pull request 7713
  [Xamarin.Android.Build.Tasks] lazily populate Resource lookup (dotnet#7686)
  [Xamarin.Android.Build.Tasks] skip XA1034 logic in some cases (dotnet#7680)
  ...
@jonpryor jonpryor merged commit 1e45033 into dotnet:main Jan 28, 2023
grendello added a commit to grendello/xamarin-android that referenced this pull request Jan 30, 2023
* main:
  [Xamarin.Android.Build.Tasks] Fix issue where app will not install (dotnet#7719)
  Bump to dotnet/installer@779a644 8.0.100-alpha.1.23070.23 (dotnet#7728)
  LEGO: Merge pull request 7751
  [Mono.Android] Wrap connection exceptions in HttpRequestException (dotnet#7661)
  [Mono.Android] Fix View.SystemUiVisibility enumification (dotnet#7730)
grendello added a commit to grendello/xamarin-android that referenced this pull request Jan 30, 2023
* main:
  [Xamarin.Android.Build.Tasks] Fix issue where app will not install (dotnet#7719)
  Bump to dotnet/installer@779a644 8.0.100-alpha.1.23070.23 (dotnet#7728)
  LEGO: Merge pull request 7751
  [Mono.Android] Wrap connection exceptions in HttpRequestException (dotnet#7661)
  [Mono.Android] Fix View.SystemUiVisibility enumification (dotnet#7730)
  Bump r8 from 3.3.75 to 4.0.48 (dotnet#7700)
  [monodroid] Prevent overlapped decompression of embedded assemblies (dotnet#7732)
  [xaprepare] Support arm64 emulator components (dotnet#7743)
  Bump SQLite to 3.40.1 (dotnet#7733)
  Bump to xamarin/xamarin-android-binutils/L_15.0.7-5.0.3@6721af4b (dotnet#7742)
  [monodroid] Replace `exit()` with `abort()` in native code (dotnet#7734)
  Bump to xamarin/Java.Interop/main@8a1ae57 (dotnet#7738)
  [build] bump `$(AndroidNet7Version)` (dotnet#7737)
  Bump to xamarin/Java.Interop/main@1366d99 (dotnet#7718)
  [Xamarin.Android.Build.Tasks] fix AndroidGenerateResourceDesigner (dotnet#7721)
  Bump to xamarin/monodroid@50faac94 (dotnet#7725)
grendello added a commit to grendello/xamarin-android that referenced this pull request Feb 9, 2023
* main: (112 commits)
  [ci] Remove classic Mono.Android-Tests runs (dotnet#7778)
  $(AndroidPackVersionSuffix)=preview.2; net8 is 34.0.0-preview.2 (dotnet#7761)
  Localized file check-in by OneLocBuild Task (dotnet#7758)
  Bump to dotnet/installer@dec1209 8.0.100-alpha.1.23080.11 (dotnet#7755)
  LEGO: Merge pull request 7756
  Localized file check-in by OneLocBuild (dotnet#7752)
  [Xamarin.Android.Build.Tasks] Fix issue where app will not install (dotnet#7719)
  Bump to dotnet/installer@779a644 8.0.100-alpha.1.23070.23 (dotnet#7728)
  LEGO: Merge pull request 7751
  [Mono.Android] Wrap connection exceptions in HttpRequestException (dotnet#7661)
  [Mono.Android] Fix View.SystemUiVisibility enumification (dotnet#7730)
  Bump r8 from 3.3.75 to 4.0.48 (dotnet#7700)
  [monodroid] Prevent overlapped decompression of embedded assemblies (dotnet#7732)
  [xaprepare] Support arm64 emulator components (dotnet#7743)
  Bump SQLite to 3.40.1 (dotnet#7733)
  Bump to xamarin/xamarin-android-binutils/L_15.0.7-5.0.3@6721af4b (dotnet#7742)
  [monodroid] Replace `exit()` with `abort()` in native code (dotnet#7734)
  Bump to xamarin/Java.Interop/main@8a1ae57 (dotnet#7738)
  [build] bump `$(AndroidNet7Version)` (dotnet#7737)
  Bump to xamarin/Java.Interop/main@1366d99 (dotnet#7718)
  ...
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong exception HttpClient when SSL certificate is expired
3 participants