Skip to content

Commit

Permalink
Version 3.4.3
Browse files Browse the repository at this point in the history
Bug fix: When a remote HTTP backend was emulated, no HTTP session could be created
  • Loading branch information
chrishamm committed Oct 4, 2022
1 parent 7cacaf1 commit 473a097
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/DuetHttpClient/Connector/PollConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static async Task<PollConnector> ConnectAsync(Uri baseUri, DuetHttpOption
if (connectResponse.IsEmulated)
{
// Don't attempt to use emulated endpoints since the remote server provides support for RESTful calls too
throw new OperationCanceledException("HTTP backend is emulated");
throw new HttpRequestException("HTTP backend is emulated");
}

if (connectResponse.ApiLevel < MinApiLevel)
Expand Down
3 changes: 3 additions & 0 deletions src/UnitTests/HttpClient/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public class Session
[OneTimeSetUp]
public async Task Connect()
{
// It may be necessary to assign an error handler first so that JSON errors are caught and the ObjectModel test completes
DuetAPI.ObjectModel.ObjectModel.OnDeserializationFailed += delegate { };

// This has to be changed depending on the test setup.
// The IP address must be either a Duet (standalone mode) or a SBC running DSF (SBC mode)
session = await DuetHttpSession.ConnectAsync(new("http://ender3pro"));
Expand Down

0 comments on commit 473a097

Please sign in to comment.