-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for design for communicating exceptions across channels
Test for #299
- Loading branch information
Showing
5 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (c) Andrew Arnott. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Nerdbank.Streams | ||
{ | ||
using System; | ||
using System.IO.Pipelines; | ||
using System.Threading; | ||
|
||
/// <summary> | ||
/// An exception thrown from <see cref="PipeReader.ReadAsync(CancellationToken)"/> | ||
/// when called on the <see cref="MultiplexingStream.Channel.Input"/> property from a | ||
/// <see cref="MultiplexingStream.Channel"/> whose remote counterpart completed | ||
/// their <see cref="MultiplexingStream.Channel.Output"/> with a fault | ||
/// using <see cref="PipeWriter.CompleteAsync(System.Exception?)"/>. | ||
/// </summary> | ||
[Serializable] | ||
public class RemoteChannelException : Exception | ||
{ | ||
/// <summary>Initializes a new instance of the <see cref="RemoteChannelException"/> class.</summary> | ||
public RemoteChannelException() | ||
{ | ||
} | ||
|
||
/// <summary>Initializes a new instance of the <see cref="RemoteChannelException"/> class.</summary> | ||
/// <inheritdoc cref="Exception(string)"/> | ||
public RemoteChannelException(string message) | ||
: base(message) | ||
{ | ||
} | ||
|
||
/// <summary>Initializes a new instance of the <see cref="RemoteChannelException"/> class.</summary> | ||
/// <inheritdoc cref="Exception(string, Exception)"/> | ||
public RemoteChannelException(string message, Exception inner) | ||
: base(message, inner) | ||
{ | ||
} | ||
|
||
/// <summary>Initializes a new instance of the <see cref="RemoteChannelException"/> class.</summary> | ||
/// <inheritdoc cref="Exception(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)"/> | ||
protected RemoteChannelException( | ||
System.Runtime.Serialization.SerializationInfo info, | ||
System.Runtime.Serialization.StreamingContext context) | ||
: base(info, context) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
Nerdbank.Streams.MultiplexingStream.QualifiedChannelId.QualifiedChannelId() -> void | ||
Nerdbank.Streams.RemoteChannelException | ||
Nerdbank.Streams.RemoteChannelException.RemoteChannelException() -> void | ||
Nerdbank.Streams.RemoteChannelException.RemoteChannelException(string! message) -> void | ||
Nerdbank.Streams.RemoteChannelException.RemoteChannelException(string! message, System.Exception! inner) -> void | ||
Nerdbank.Streams.RemoteChannelException.RemoteChannelException(System.Runtime.Serialization.SerializationInfo! info, System.Runtime.Serialization.StreamingContext context) -> void | ||
static Nerdbank.Streams.PipeExtensions.AsPrebufferedStreamAsync(this System.IO.Pipelines.PipeReader! pipeReader, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<System.IO.Stream!>! | ||
static Nerdbank.Streams.StreamExtensions.AsStream(this System.Buffers.ReadOnlySequence<byte> readOnlySequence, System.Action<object?>? disposeAction, object? disposeActionArg) -> System.IO.Stream! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
Nerdbank.Streams.MultiplexingStream.QualifiedChannelId.QualifiedChannelId() -> void | ||
Nerdbank.Streams.RemoteChannelException | ||
Nerdbank.Streams.RemoteChannelException.RemoteChannelException() -> void | ||
Nerdbank.Streams.RemoteChannelException.RemoteChannelException(string! message) -> void | ||
Nerdbank.Streams.RemoteChannelException.RemoteChannelException(string! message, System.Exception! inner) -> void | ||
Nerdbank.Streams.RemoteChannelException.RemoteChannelException(System.Runtime.Serialization.SerializationInfo! info, System.Runtime.Serialization.StreamingContext context) -> void | ||
static Nerdbank.Streams.PipeExtensions.AsPrebufferedStreamAsync(this System.IO.Pipelines.PipeReader! pipeReader, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<System.IO.Stream!>! | ||
static Nerdbank.Streams.StreamExtensions.AsStream(this System.Buffers.ReadOnlySequence<byte> readOnlySequence, System.Action<object?>? disposeAction, object? disposeActionArg) -> System.IO.Stream! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
Nerdbank.Streams.MultiplexingStream.QualifiedChannelId.QualifiedChannelId() -> void | ||
Nerdbank.Streams.RemoteChannelException | ||
Nerdbank.Streams.RemoteChannelException.RemoteChannelException() -> void | ||
Nerdbank.Streams.RemoteChannelException.RemoteChannelException(string! message) -> void | ||
Nerdbank.Streams.RemoteChannelException.RemoteChannelException(string! message, System.Exception! inner) -> void | ||
Nerdbank.Streams.RemoteChannelException.RemoteChannelException(System.Runtime.Serialization.SerializationInfo! info, System.Runtime.Serialization.StreamingContext context) -> void | ||
static Nerdbank.Streams.PipeExtensions.AsPrebufferedStreamAsync(this System.IO.Pipelines.PipeReader! pipeReader, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<System.IO.Stream!>! | ||
static Nerdbank.Streams.StreamExtensions.AsStream(this System.Buffers.ReadOnlySequence<byte> readOnlySequence, System.Action<object?>? disposeAction, object? disposeActionArg) -> System.IO.Stream! |