Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libplctag.Tests/AsyncTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public async Task Timeout_throws_a_LibPlcTagException()
});

// Assert
Assert.Equal(Status.ErrorTimeout.ToString(), ex.Message);
Assert.Equal(Status.ErrorTimeout, ex.Status);
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion src/libplctag.Tests/DisposeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public async Task GithubIssue418()
{
await tag.InitializeAsync();
}
catch (Exception e) when (e.Message == "ErrorNotFound") // we are expecting this exception
catch (LibPlcTagException e) when (e.Status == Status.ErrorNotFound) // we are expecting this exception
{
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/libplctag/LibPlcTagException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ namespace libplctag
/// </summary>
public class LibPlcTagException : Exception
{
public Status Status { get; }

public LibPlcTagException()
{
}
Expand All @@ -32,6 +34,7 @@ public LibPlcTagException(string message, Exception inner)
public LibPlcTagException(Status status)
: base(status.ToString())
{
Status = status;
}
}
}
Loading