Skip to content

Commit 61b4c70

Browse files
committed
Updated documentation for exception classes
1 parent 0fe2d26 commit 61b4c70

10 files changed

Lines changed: 253 additions & 15 deletions

src/corelib/Core/Exceptions/CDNNotEnabledException.cs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,41 @@
11
using System;
22
using System.Runtime.Serialization;
3+
using net.openstack.Core.Providers;
34

45
namespace net.openstack.Core.Exceptions
56
{
7+
/// <summary>
8+
/// The exception that is thrown when an attempt is made to modify CDN properties
9+
/// of a container which is not CDN-enabled.
10+
/// </summary>
11+
/// <seealso cref="IObjectStorageProvider"/>
612
[Serializable]
713
public class CDNNotEnabledException : Exception
814
{
9-
public CDNNotEnabledException() { }
15+
/// <summary>
16+
/// Initializes a new instance of the <see cref="CDNNotEnabledException"/> class.
17+
/// </summary>
18+
public CDNNotEnabledException()
19+
{
20+
}
1021

11-
public CDNNotEnabledException(string message) : base(message) { }
22+
/// <summary>
23+
/// Initializes a new instance of the <see cref="CDNNotEnabledException"/> class
24+
/// with the specified error message.
25+
/// </summary>
26+
/// <param name="message">The message that describes the error.</param>
27+
public CDNNotEnabledException(string message)
28+
: base(message)
29+
{
30+
}
1231

32+
/// <summary>
33+
/// Initializes a new instance of the <see cref="CDNNotEnabledException"/> class with
34+
/// serialized data.
35+
/// </summary>
36+
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
37+
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
38+
/// <exception cref="ArgumentNullException">If <paramref name="info"/> is <c>null</c>.</exception>
1339
protected CDNNotEnabledException(SerializationInfo info, StreamingContext context)
1440
: base(info, context)
1541
{

src/corelib/Core/Exceptions/CidrFormatException.cs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,40 @@
11
using System;
22
using System.Runtime.Serialization;
3+
using net.openstack.Core.Validators;
34

45
namespace net.openstack.Core.Exceptions
56
{
7+
/// <summary>
8+
/// Represents errors that occur while validating a CIDR.
9+
/// </summary>
10+
/// <seealso cref="INetworksValidator.ValidateCidr"/>
611
[Serializable]
712
public class CidrFormatException : Exception
813
{
9-
public CidrFormatException() { }
14+
/// <summary>
15+
/// Initializes a new instance of the <see cref="CidrFormatException"/> class.
16+
/// </summary>
17+
public CidrFormatException()
18+
{
19+
}
1020

11-
public CidrFormatException(string message) : base(message) { }
21+
/// <summary>
22+
/// Initializes a new instance of the <see cref="CidrFormatException"/> class
23+
/// with the specified error message.
24+
/// </summary>
25+
/// <param name="message">The message that describes the error.</param>
26+
public CidrFormatException(string message)
27+
: base(message)
28+
{
29+
}
1230

31+
/// <summary>
32+
/// Initializes a new instance of the <see cref="CidrFormatException"/> class with
33+
/// serialized data.
34+
/// </summary>
35+
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
36+
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
37+
/// <exception cref="ArgumentNullException">If <paramref name="info"/> is <c>null</c>.</exception>
1338
protected CidrFormatException(SerializationInfo info, StreamingContext context)
1439
: base(info, context)
1540
{

src/corelib/Core/Exceptions/ContainerNameException.cs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,41 @@
11
using System;
22
using System.Runtime.Serialization;
3+
using net.openstack.Core.Providers;
4+
using net.openstack.Core.Validators;
35

46
namespace net.openstack.Core.Exceptions
57
{
8+
/// <summary>
9+
/// Represents errors that occur while validating a container name for an <see cref="IObjectStorageProvider"/>.
10+
/// </summary>
11+
/// <seealso cref="IObjectStorageValidator.ValidateContainerName"/>
612
[Serializable]
713
public class ContainerNameException : Exception
814
{
9-
public ContainerNameException() { }
15+
/// <summary>
16+
/// Initializes a new instance of the <see cref="ContainerNameException"/> class.
17+
/// </summary>
18+
public ContainerNameException()
19+
{
20+
}
1021

11-
public ContainerNameException(string message) : base(message) { }
22+
/// <summary>
23+
/// Initializes a new instance of the <see cref="ContainerNameException"/> class
24+
/// with the specified error message.
25+
/// </summary>
26+
/// <param name="message">The message that describes the error.</param>
27+
public ContainerNameException(string message)
28+
: base(message)
29+
{
30+
}
1231

32+
/// <summary>
33+
/// Initializes a new instance of the <see cref="ContainerNameException"/> class with
34+
/// serialized data.
35+
/// </summary>
36+
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
37+
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
38+
/// <exception cref="ArgumentNullException">If <paramref name="info"/> is <c>null</c>.</exception>
1339
protected ContainerNameException(SerializationInfo info, StreamingContext context)
1440
: base(info, context)
1541
{

src/corelib/Core/Exceptions/InvalidCloudIdentityException.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
using System;
22
using System.Runtime.Serialization;
3+
using net.openstack.Core.Domain;
34

45
namespace net.openstack.Core.Exceptions
56
{
7+
/// <summary>
8+
/// The exception thrown when the <see cref="CloudIdentity"/> instance passed
9+
/// to a provider method is not supported by that provider.
10+
/// </summary>
611
[Serializable]
712
internal class InvalidCloudIdentityException : Exception
813
{
9-
public InvalidCloudIdentityException(string message) : base(message) {}
14+
/// <summary>
15+
/// Initializes a new instance of the <see cref="InvalidCloudIdentityException"/> class
16+
/// with the specified error message.
17+
/// </summary>
18+
/// <param name="message">The message that describes the error.</param>
19+
public InvalidCloudIdentityException(string message)
20+
: base(message)
21+
{
22+
}
1023

24+
/// <summary>
25+
/// Initializes a new instance of the <see cref="InvalidCloudIdentityException"/> class with
26+
/// serialized data.
27+
/// </summary>
28+
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
29+
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
30+
/// <exception cref="ArgumentNullException">If <paramref name="info"/> is <c>null</c>.</exception>
1131
protected InvalidCloudIdentityException(SerializationInfo info, StreamingContext context)
1232
: base(info, context)
1333
{

src/corelib/Core/Exceptions/NoDefaultRegionSetException.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,30 @@
33

44
namespace net.openstack.Core.Exceptions
55
{
6+
/// <summary>
7+
/// The exception that is thrown when a service endpoint could not be obtained because
8+
/// no region was specified and no default region is available for the provider.
9+
/// </summary>
610
[Serializable]
711
public class NoDefaultRegionSetException : Exception
812
{
9-
public NoDefaultRegionSetException(string message) : base(message)
13+
/// <summary>
14+
/// Initializes a new instance of the <see cref="NoDefaultRegionSetException"/> class
15+
/// with the specified error message.
16+
/// </summary>
17+
/// <param name="message">The message that describes the error.</param>
18+
public NoDefaultRegionSetException(string message)
19+
: base(message)
1020
{
1121
}
1222

23+
/// <summary>
24+
/// Initializes a new instance of the <see cref="NoDefaultRegionSetException"/> class with
25+
/// serialized data.
26+
/// </summary>
27+
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
28+
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
29+
/// <exception cref="ArgumentNullException">If <paramref name="info"/> is <c>null</c>.</exception>
1330
protected NoDefaultRegionSetException(SerializationInfo info, StreamingContext context)
1431
: base(info, context)
1532
{

src/corelib/Core/Exceptions/ObjectNameException.cs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,41 @@
11
using System;
22
using System.Runtime.Serialization;
3+
using net.openstack.Core.Providers;
4+
using net.openstack.Core.Validators;
35

46
namespace net.openstack.Core.Exceptions
57
{
8+
/// <summary>
9+
/// Represents errors that occur while validating an object name for an <see cref="IObjectStorageProvider"/>.
10+
/// </summary>
11+
/// <seealso cref="IObjectStorageValidator.ValidateObjectName"/>
612
[Serializable]
713
public class ObjectNameException : Exception
814
{
9-
public ObjectNameException() { }
15+
/// <summary>
16+
/// Initializes a new instance of the <see cref="ObjectNameException"/> class.
17+
/// </summary>
18+
public ObjectNameException()
19+
{
20+
}
1021

11-
public ObjectNameException(string message) : base(message) { }
22+
/// <summary>
23+
/// Initializes a new instance of the <see cref="ObjectNameException"/> class
24+
/// with the specified error message.
25+
/// </summary>
26+
/// <param name="message">The message that describes the error.</param>
27+
public ObjectNameException(string message)
28+
: base(message)
29+
{
30+
}
1231

32+
/// <summary>
33+
/// Initializes a new instance of the <see cref="ObjectNameException"/> class with
34+
/// serialized data.
35+
/// </summary>
36+
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
37+
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
38+
/// <exception cref="ArgumentNullException">If <paramref name="info"/> is <c>null</c>.</exception>
1339
protected ObjectNameException(SerializationInfo info, StreamingContext context)
1440
: base(info, context)
1541
{

src/corelib/Core/Exceptions/ServerEnteredErrorStateException.cs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,57 @@
11
using System;
22
using System.Runtime.Serialization;
33
using System.Security;
4+
using net.openstack.Core.Domain;
5+
using net.openstack.Core.Providers;
46

57
namespace net.openstack.Core.Exceptions
68
{
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>
713
[Serializable]
814
public class ServerEnteredErrorStateException : Exception
915
{
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+
}
1126

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>
1232
public ServerEnteredErrorStateException(string status)
1333
: base(string.Format("The server entered an error state: '{0}'", status))
1434
{
1535
Status = status;
1636
}
1737

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>
1845
protected ServerEnteredErrorStateException(SerializationInfo info, StreamingContext context)
1946
: base(info, context)
2047
{
48+
if (info == null)
49+
throw new ArgumentNullException("info");
50+
2151
Status = (string)info.GetValue("Status", typeof(string));
2252
}
2353

54+
/// <inheritdoc/>
2455
[SecurityCritical]
2556
public override void GetObjectData(SerializationInfo info, StreamingContext context)
2657
{

src/corelib/Core/Exceptions/TTLLengthException.cs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,37 @@
33

44
namespace net.openstack.Core.Exceptions
55
{
6+
/// <summary>
7+
/// The exception that is thrown when the TTL argument to a method is outside
8+
/// the range supported by the provider.
9+
/// </summary>
610
[Serializable]
711
public class TTLLengthException : Exception
812
{
9-
public TTLLengthException() { }
13+
/// <summary>
14+
/// Initializes a new instance of the <see cref="TTLLengthException"/> class.
15+
/// </summary>
16+
public TTLLengthException()
17+
{
18+
}
1019

11-
public TTLLengthException(string message) : base(message) { }
20+
/// <summary>
21+
/// Initializes a new instance of the <see cref="TTLLengthException"/> class
22+
/// with the specified error message.
23+
/// </summary>
24+
/// <param name="message">The message that describes the error.</param>
25+
public TTLLengthException(string message)
26+
: base(message)
27+
{
28+
}
1229

30+
/// <summary>
31+
/// Initializes a new instance of the <see cref="TTLLengthException"/> class with
32+
/// serialized data.
33+
/// </summary>
34+
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
35+
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
36+
/// <exception cref="ArgumentNullException">If <paramref name="info"/> is <c>null</c>.</exception>
1337
protected TTLLengthException(SerializationInfo info, StreamingContext context)
1438
: base(info, context)
1539
{

src/corelib/Core/Exceptions/UserAuthenticationException.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
using System;
22
using System.Runtime.Serialization;
3+
using net.openstack.Core.Domain;
34

45
namespace net.openstack.Core.Exceptions
56
{
7+
/// <summary>
8+
/// The exception thrown when the user authentication process fails, or
9+
/// the authentication process did not provide a value for the <see cref="UserAccess.ServiceCatalog"/>.
10+
/// </summary>
611
[Serializable]
712
public class UserAuthenticationException : Exception
813
{
9-
public UserAuthenticationException(string message) : base(message) {}
14+
/// <summary>
15+
/// Initializes a new instance of the <see cref="UserAuthenticationException"/> class
16+
/// with the specified error message.
17+
/// </summary>
18+
/// <param name="message">The message that describes the error.</param>
19+
public UserAuthenticationException(string message)
20+
: base(message)
21+
{
22+
}
1023

24+
/// <summary>
25+
/// Initializes a new instance of the <see cref="UserAuthenticationException"/> class with
26+
/// serialized data.
27+
/// </summary>
28+
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
29+
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
30+
/// <exception cref="ArgumentNullException">If <paramref name="info"/> is <c>null</c>.</exception>
1131
protected UserAuthenticationException(SerializationInfo info, StreamingContext context)
1232
: base(info, context)
1333
{

0 commit comments

Comments
 (0)