|
1 | 1 | using System; |
2 | 2 | using System.Runtime.Serialization; |
3 | 3 | using System.Security; |
| 4 | +using net.openstack.Core.Domain; |
| 5 | +using net.openstack.Core.Providers; |
4 | 6 |
|
5 | 7 | namespace net.openstack.Core.Exceptions |
6 | 8 | { |
| 9 | + /// <summary> |
| 10 | + /// The exception that is thrown when the server enters an error state during a |
| 11 | + /// call to <see cref="O:IComputeProvider.WaitForServerState"/> or <see cref="O:IComputeProvider.WaitForImageState"/>. |
| 12 | + /// </summary> |
7 | 13 | [Serializable] |
8 | 14 | public class ServerEnteredErrorStateException : Exception |
9 | 15 | { |
10 | | - public string Status { get; private set; } |
| 16 | + /// <summary> |
| 17 | + /// The state of the server or image. |
| 18 | + /// </summary> |
| 19 | + /// <seealso cref="ServerState"/> |
| 20 | + /// <seealso cref="ImageState"/> |
| 21 | + public string Status |
| 22 | + { |
| 23 | + get; |
| 24 | + private set; |
| 25 | + } |
11 | 26 |
|
| 27 | + /// <summary> |
| 28 | + /// Initializes a new instance of the <see cref="ServerEnteredErrorStateException"/> class |
| 29 | + /// with the specified error state. |
| 30 | + /// </summary> |
| 31 | + /// <param name="status">The error state entered by the server or image.</param> |
12 | 32 | public ServerEnteredErrorStateException(string status) |
13 | 33 | : base(string.Format("The server entered an error state: '{0}'", status)) |
14 | 34 | { |
15 | 35 | Status = status; |
16 | 36 | } |
17 | 37 |
|
| 38 | + /// <summary> |
| 39 | + /// Initializes a new instance of the <see cref="ServerEnteredErrorStateException"/> class with |
| 40 | + /// serialized data. |
| 41 | + /// </summary> |
| 42 | + /// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param> |
| 43 | + /// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param> |
| 44 | + /// <exception cref="ArgumentNullException">If <paramref name="info"/> is <c>null</c>.</exception> |
18 | 45 | protected ServerEnteredErrorStateException(SerializationInfo info, StreamingContext context) |
19 | 46 | : base(info, context) |
20 | 47 | { |
| 48 | + if (info == null) |
| 49 | + throw new ArgumentNullException("info"); |
| 50 | + |
21 | 51 | Status = (string)info.GetValue("Status", typeof(string)); |
22 | 52 | } |
23 | 53 |
|
| 54 | + /// <inheritdoc/> |
24 | 55 | [SecurityCritical] |
25 | 56 | public override void GetObjectData(SerializationInfo info, StreamingContext context) |
26 | 57 | { |
|
0 commit comments