21
21
using Droog . Beanstalk . Client . Protocol ;
22
22
23
23
namespace Droog . Beanstalk . Client {
24
- public abstract class BeanstalkClientExceptions : Exception {
25
- protected BeanstalkClientExceptions ( ) { }
26
- protected BeanstalkClientExceptions ( string message ) : base ( message ) { }
27
- protected BeanstalkClientExceptions ( string message , Exception exception ) : base ( message , exception ) { }
24
+ public abstract class BeanstalkClientException : Exception {
25
+ protected BeanstalkClientException ( ) { }
26
+ protected BeanstalkClientException ( string message ) : base ( message ) { }
27
+ protected BeanstalkClientException ( string message , Exception exception ) : base ( message , exception ) { }
28
28
}
29
29
30
30
public class EmptyResponseException : ConnectionException { }
31
- public abstract class ConnectionException : BeanstalkClientExceptions {
31
+ public abstract class ConnectionException : BeanstalkClientException {
32
32
protected ConnectionException ( ) { }
33
33
protected ConnectionException ( string message ) : base ( message ) { }
34
34
@@ -37,24 +37,25 @@ public class ReadException : ConnectionException {
37
37
public ReadException ( string message ) : base ( message ) { }
38
38
}
39
39
public class WriteException : ConnectionException { }
40
- public class DeadlineSoonException : BeanstalkClientExceptions { }
41
- public class ShouldNeverHappenException : BeanstalkClientExceptions { }
40
+ public class TimedoutException : BeanstalkClientException { }
41
+ public class DeadlineSoonException : BeanstalkClientException { }
42
+ public class ShouldNeverHappenException : BeanstalkClientException { }
42
43
43
- public class ConnectException : BeanstalkClientExceptions {
44
+ public class ConnectException : BeanstalkClientException {
44
45
public ConnectException ( Exception exception )
45
46
: base ( "Unable to Connect to Beanstalk server" , exception ) {
46
47
}
47
48
}
48
49
49
- public class UnknowResponseException : BeanstalkClientExceptions {
50
+ public class UnknowResponseException : BeanstalkClientException {
50
51
public readonly string Response ;
51
52
public UnknowResponseException ( string response )
52
53
: base ( string . Format ( "Response '{0}' is not supported by this client" , response ) ) {
53
54
Response = response ;
54
55
}
55
56
}
56
57
57
- public class InvalidStatusException : BeanstalkClientExceptions {
58
+ public class InvalidStatusException : BeanstalkClientException {
58
59
public readonly RequestCommand Command ;
59
60
public readonly ResponseStatus Status ;
60
61
@@ -65,12 +66,20 @@ public InvalidStatusException(RequestCommand command, ResponseStatus status)
65
66
}
66
67
}
67
68
68
- public class PutFailedException : BeanstalkClientExceptions {
69
+ public class PutFailedException : BeanstalkClientException {
69
70
public readonly ResponseStatus Status ;
70
71
71
72
public PutFailedException ( ResponseStatus status )
72
73
: base ( string . Format ( "Put failed with response '{0}'" , status ) ) {
73
74
Status = status ;
74
75
}
75
76
}
77
+
78
+ public class InvalidReleaseStatusException : BeanstalkClientException {
79
+ public readonly ResponseStatus Status ;
80
+ public InvalidReleaseStatusException ( ResponseStatus status )
81
+ : base ( string . Format ( "Unable to convert response status '{0}' to ReleaseStatus" , status ) ) {
82
+ Status = status ;
83
+ }
84
+ }
76
85
}
0 commit comments