Permalink
Browse files

Various custom exceptions are now cross-appdomain friendly

  • Loading branch information...
1 parent 90eaeb0 commit e3863d1dceb16a3d66c193199cbc7bc60b29c7a4 @abolibibelot abolibibelot committed Jul 6, 2010
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.Serialization;
namespace MongoDB
{
@@ -13,5 +14,20 @@ public class IdGenerationException : MongoException
/// </summary>
/// <param name="message">The message.</param>
public IdGenerationException(string message) : base(message) { }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="IdGenerationException"/> class.
+ /// </summary>
+ /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
+ /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
+ /// <exception cref="T:System.ArgumentNullException">
+ /// The <paramref name="info"/> parameter is null.
+ /// </exception>
+ /// <exception cref="T:System.Runtime.Serialization.SerializationException">
+ /// The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0).
+ /// </exception>
+ public IdGenerationException(SerializationInfo info, StreamingContext context) : base(info,context)
+ {
+ }
}
}
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.Serialization;
namespace MongoDB
{
@@ -36,6 +37,21 @@ public MongoCommandException(string message, Document error, Document command, E
}
/// <summary>
+ /// Initializes a new instance of the <see cref="MongoCommandException"/> class.
+ /// </summary>
+ /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
+ /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
+ /// <exception cref="T:System.ArgumentNullException">
+ /// The <paramref name="info"/> parameter is null.
+ /// </exception>
+ /// <exception cref="T:System.Runtime.Serialization.SerializationException">
+ /// The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0).
+ /// </exception>
+ public MongoCommandException(SerializationInfo info, StreamingContext context) : base(info,context)
+ {
+ }
+
+ /// <summary>
/// Gets or sets the error.
/// </summary>
/// <value>The error.</value>
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.Serialization;
using MongoDB.Connections;
namespace MongoDB
@@ -65,6 +66,22 @@ internal MongoConnectionException(string message, Connection connection, Excepti
throw new ArgumentNullException("connection");
ConnectionString = connection.ConnectionString;
EndPoint = connection.EndPoint;
- }
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MongoConnectionException"/> class.
+ /// </summary>
+ /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
+ /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
+ /// <exception cref="T:System.ArgumentNullException">
+ /// The <paramref name="info"/> parameter is null.
+ /// </exception>
+ /// <exception cref="T:System.Runtime.Serialization.SerializationException">
+ /// The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0).
+ /// </exception>
+ public MongoConnectionException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ }
}
}
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.Serialization;
namespace MongoDB
{
@@ -22,5 +23,21 @@ public class MongoDuplicateKeyException : MongoOperationException
/// <param name="error">The error.</param>
/// <param name="e">The e.</param>
public MongoDuplicateKeyException(string message, Document error, Exception e):base(message, error,e){}
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MongoDuplicateKeyException"/> class.
+ /// </summary>
+ /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
+ /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
+ /// <exception cref="T:System.ArgumentNullException">
+ /// The <paramref name="info"/> parameter is null.
+ /// </exception>
+ /// <exception cref="T:System.Runtime.Serialization.SerializationException">
+ /// The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0).
+ /// </exception>
+ public MongoDuplicateKeyException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ }
}
}
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.Serialization;
namespace MongoDB
{
@@ -26,5 +27,21 @@ public MongoDuplicateKeyUpdateException(string message, Document error)
/// <param name="error">The error.</param>
/// <param name="e">The e.</param>
public MongoDuplicateKeyUpdateException(string message, Document error, Exception e):base(message, error,e){}
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MongoDuplicateKeyUpdateException"/> class.
+ /// </summary>
+ /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
+ /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
+ /// <exception cref="T:System.ArgumentNullException">
+ /// The <paramref name="info"/> parameter is null.
+ /// </exception>
+ /// <exception cref="T:System.Runtime.Serialization.SerializationException">
+ /// The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0).
+ /// </exception>
+ public MongoDuplicateKeyUpdateException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ }
}
}
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.Serialization;
namespace MongoDB
{
@@ -20,5 +21,20 @@ public class MongoException : Exception
/// </summary>
/// <param name="message">The message.</param>
public MongoException(string message):base(message){}
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MongoException"/> class.
+ /// </summary>
+ /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
+ /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
+ /// <exception cref="T:System.ArgumentNullException">
+ /// The <paramref name="info"/> parameter is null.
+ /// </exception>
+ /// <exception cref="T:System.Runtime.Serialization.SerializationException">
+ /// The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0).
+ /// </exception>
+ public MongoException(SerializationInfo info, StreamingContext context) : base(info,context)
+ {
+ }
}
}
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.Serialization;
using MongoDB.Results;
namespace MongoDB
@@ -23,5 +24,21 @@ public MongoMapReduceException(MongoCommandException exception)
:base(exception.Message,exception.Error, exception.Command) {
MapReduceResult = new MapReduceResult(exception.Error);
}
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MongoMapReduceException"/> class.
+ /// </summary>
+ /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
+ /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
+ /// <exception cref="T:System.ArgumentNullException">
+ /// The <paramref name="info"/> parameter is null.
+ /// </exception>
+ /// <exception cref="T:System.Runtime.Serialization.SerializationException">
+ /// The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0).
+ /// </exception>
+ public MongoMapReduceException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ }
}
}
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.Serialization;
namespace MongoDB
{
@@ -29,6 +30,22 @@ public class MongoOperationException : MongoException
/// <param name="e">The e.</param>
public MongoOperationException(string message, Document error, Exception e):base(message,e){
this.Error = error;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MongoOperationException"/> class.
+ /// </summary>
+ /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
+ /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
+ /// <exception cref="T:System.ArgumentNullException">
+ /// The <paramref name="info"/> parameter is null.
+ /// </exception>
+ /// <exception cref="T:System.Runtime.Serialization.SerializationException">
+ /// The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0).
+ /// </exception>
+ public MongoOperationException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
}
}
}
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.Serialization;
namespace MongoDB
{
@@ -13,5 +14,21 @@ public class UnmappedMemberException : MongoException
/// </summary>
/// <param name="message">The message.</param>
public UnmappedMemberException(string message) : base(message) { }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="UnmappedMemberException"/> class.
+ /// </summary>
+ /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
+ /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
+ /// <exception cref="T:System.ArgumentNullException">
+ /// The <paramref name="info"/> parameter is null.
+ /// </exception>
+ /// <exception cref="T:System.Runtime.Serialization.SerializationException">
+ /// The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0).
+ /// </exception>
+ public UnmappedMemberException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ }
}
}

0 comments on commit e3863d1

Please sign in to comment.