Skip to content

Commit fb56cb4

Browse files
committed
(pardahlman#143) Throw ChannelAvailabilityException
1 parent fca27b2 commit fb56cb4

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/RawRabbit/Channel/ChannelFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using RabbitMQ.Client.Exceptions;
99
using RawRabbit.Channel.Abstraction;
1010
using RawRabbit.Configuration;
11+
using RawRabbit.Exceptions;
1112
using RawRabbit.Logging;
1213

1314
namespace RawRabbit.Channel
@@ -208,7 +209,7 @@ private void EnsureRequestsAreHandled()
208209
var isRecoverable = _channels.Any(c => c is IRecoverable);
209210
if (!isRecoverable)
210211
{
211-
throw new Exception("Unable to retreive channel. All existing channels are closed and none of them are recoverable.");
212+
throw new ChannelAvailabilityException("Unable to retreive channel. All existing channels are closed and none of them are recoverable.");
212213
}
213214

214215
_logger.LogInformation("Unable to find an open channel. Requeue TaskCompletionSource for future process and abort execution.");
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
3+
namespace RawRabbit.Exceptions
4+
{
5+
public class ChannelAvailabilityException : Exception
6+
{
7+
public ChannelAvailabilityException(string message) : base(message)
8+
{ }
9+
}
10+
}

0 commit comments

Comments
 (0)