Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv24599
Modified Files:
FactoryObjectNotInitializedException.cs
ObjectCreationException.cs
ObjectCurrentlyInCreationException.cs
Log Message:
Update use of 'ObjectCreationException's for better message exceptions.
Index: ObjectCreationException.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/ObjectCreationException.cs,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** ObjectCreationException.cs 1 Aug 2007 23:24:24 -0000 1.14
--- ObjectCreationException.cs 5 Dec 2007 00:28:04 -0000 1.15
***************
*** 71,82 ****
/// A message about the exception.
/// </param>
! /// <param name="name">
/// The name of the object that triggered the exception.
/// </param>
! public ObjectCreationException(string name, string message)
! : this(name, message, null as Exception)
{
}
/// <summary>
/// Creates a new instance of the
--- 71,97 ----
/// A message about the exception.
/// </param>
! /// <param name="objectName">
/// The name of the object that triggered the exception.
/// </param>
! public ObjectCreationException(string objectName, string message)
! : this(null, objectName, message, null)
{
}
+ /// <summary>
+ /// Creates a new instance of the
+ /// <see cref="Spring.Objects.Factory.ObjectCreationException"/> class.
+ /// </summary>
+ /// <param name="message">
+ /// A message about the exception.
+ /// </param>
+ /// <param name="rootCause">
+ /// The root exception that is being wrapped.
+ /// </param>
+ public ObjectCreationException(string message, Exception rootCause)
+ : base(message, rootCause)
+ {
+ }
+
/// <summary>
/// Creates a new instance of the
***************
*** 86,90 ****
/// A message about the exception.
/// </param>
! /// <param name="name">
/// The name of the object that triggered the exception.
/// </param>
--- 101,105 ----
/// A message about the exception.
/// </param>
! /// <param name="objectName">
/// The name of the object that triggered the exception.
/// </param>
***************
*** 93,98 ****
/// </param>
public ObjectCreationException(
! string name, string message, Exception rootCause)
! : this(null, name, message, rootCause)
{
}
--- 108,113 ----
/// </param>
public ObjectCreationException(
! string objectName, string message, Exception rootCause)
! : this(null, objectName, message, rootCause)
{
}
***************
*** 108,119 ****
/// A message about the exception.
/// </param>
! /// <param name="name">
/// The name of the object that triggered the exception.
/// </param>
public ObjectCreationException(
string resourceDescription,
! string name,
string message)
! : this(resourceDescription, name, message, null)
{
}
--- 123,134 ----
/// A message about the exception.
/// </param>
! /// <param name="objectName">
/// The name of the object that triggered the exception.
/// </param>
public ObjectCreationException(
string resourceDescription,
! string objectName,
string message)
! : this(resourceDescription, objectName, message, null)
{
}
***************
*** 129,133 ****
/// A message about the exception.
/// </param>
! /// <param name="name">
/// The name of the object that triggered the exception.
/// </param>
--- 144,148 ----
/// A message about the exception.
/// </param>
! /// <param name="objectName">
/// The name of the object that triggered the exception.
/// </param>
***************
*** 137,141 ****
public ObjectCreationException(
string resourceDescription,
! string name,
string message,
Exception rootCause)
--- 152,156 ----
public ObjectCreationException(
string resourceDescription,
! string objectName,
string message,
Exception rootCause)
***************
*** 143,162 ****
{
_resourceDescription = resourceDescription;
! _objectName = name;
! }
!
! /// <summary>
! /// Creates a new instance of the
! /// <see cref="Spring.Objects.Factory.ObjectCreationException"/> class.
! /// </summary>
! /// <param name="message">
! /// A message about the exception.
! /// </param>
! /// <param name="rootCause">
! /// The root exception that is being wrapped.
! /// </param>
! public ObjectCreationException(string message, Exception rootCause)
! : base(message, rootCause)
! {
}
--- 158,162 ----
{
_resourceDescription = resourceDescription;
! _objectName = objectName;
}
***************
*** 238,242 ****
private static string FormatMessage(
string resourceDescription,
! string name,
string message,
string callStack)
--- 238,242 ----
private static string FormatMessage(
string resourceDescription,
! string objectName,
string message,
string callStack)
***************
*** 247,256 ****
string.Format(
"Error creating object with name '{0}' : {1}",
! name,
message)
:
string.Format(
"Error creating object with name '{0}' defined in '{1}' : {2}",
! name,
resourceDescription,
message);
--- 247,256 ----
string.Format(
"Error creating object with name '{0}' : {1}",
! objectName,
message)
:
string.Format(
"Error creating object with name '{0}' defined in '{1}' : {2}",
! objectName,
resourceDescription,
message);
***************
*** 261,265 ****
string.Format(
"Error thrown by a dependency of object '{0}' : {1}{2}",
! name,
message,
callStack)
--- 261,265 ----
string.Format(
"Error thrown by a dependency of object '{0}' : {1}{2}",
! objectName,
message,
callStack)
***************
*** 267,271 ****
string.Format(
"Error thrown by a dependency of object '{0}' defined in '{1}' : {2}{3}",
! name,
resourceDescription,
message,
--- 267,271 ----
string.Format(
"Error thrown by a dependency of object '{0}' defined in '{1}' : {2}{3}",
! objectName,
resourceDescription,
message,
Index: FactoryObjectNotInitializedException.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/FactoryObjectNotInitializedException.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** FactoryObjectNotInitializedException.cs 9 Apr 2006 07:18:48 -0000 1.3
--- FactoryObjectNotInitializedException.cs 5 Dec 2007 00:28:04 -0000 1.4
***************
*** 93,97 ****
/// FactoryObjectCircularReferenceException class.
/// </summary>
! /// <param name="name">
/// The name of the object that triggered the exception.
/// </param>
--- 93,97 ----
/// FactoryObjectCircularReferenceException class.
/// </summary>
! /// <param name="objectName">
/// The name of the object that triggered the exception.
/// </param>
***************
*** 99,104 ****
/// A message about the exception.
/// </param>
! public FactoryObjectNotInitializedException(string name, string message)
! : base(name, StringUtils.HasText(message) ? message :
"Circular dependency chain detected for factory object.")
{
--- 99,104 ----
/// A message about the exception.
/// </param>
! public FactoryObjectNotInitializedException(string objectName, string message)
! : base(objectName, StringUtils.HasText(message) ? message :
"Circular dependency chain detected for factory object.")
{
Index: ObjectCurrentlyInCreationException.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/ObjectCurrentlyInCreationException.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ObjectCurrentlyInCreationException.cs 9 Apr 2006 07:18:48 -0000 1.5
--- ObjectCurrentlyInCreationException.cs 5 Dec 2007 00:28:04 -0000 1.6
***************
*** 44,90 ****
public class ObjectCurrentlyInCreationException : ObjectCreationException
{
! /// <summary>
! /// Creates a new instance of the ObjectCurrentlyInCreationException class.
! /// </summary>
public ObjectCurrentlyInCreationException()
{
}
! /// <summary>
! /// Creates a new instance of the ObjectCurrentlyInCreationException class.
! /// </summary>
/// <param name="message">
/// A message about the exception.
/// </param>
! public ObjectCurrentlyInCreationException(string message) : base(message)
{
}
! /// <summary>
! /// Creates a new instance of the ObjectCurrentlyInCreationException class.
/// </summary>
/// <param name="message">
/// A message about the exception.
/// </param>
/// <param name="rootCause">
/// The root exception that is being wrapped.
/// </param>
! public ObjectCurrentlyInCreationException(string message, Exception rootCause)
! : base(message, rootCause)
{
}
! /// <summary>
! /// Creates a new instance of the ObjectCurrentlyInCreationException class.
/// </summary>
! /// <param name="name">
/// The name of the object that triggered the exception.
/// </param>
/// <param name="message">
/// A message about the exception.
/// </param>
! public ObjectCurrentlyInCreationException(string name, string message)
! : base(name, StringUtils.HasText(message) ? message :
! "Requested object is currently in creation (circular reference when autowiring constructor?).")
{
}
--- 44,162 ----
public class ObjectCurrentlyInCreationException : ObjectCreationException
{
! /// <summary>
! /// Creates a new instance of the
! /// <see cref="Spring.Objects.Factory.ObjectCurrentlyInCreationException"/> class.
! /// </summary>
public ObjectCurrentlyInCreationException()
{
}
! /// <summary>
! /// Creates a new instance of the
! /// <see cref="Spring.Objects.Factory.ObjectCurrentlyInCreationException"/> class.
! /// </summary>
/// <param name="message">
/// A message about the exception.
/// </param>
! public ObjectCurrentlyInCreationException(string message)
! : base(message)
{
}
! /// <summary>
! /// Creates a new instance of the
! /// <see cref="Spring.Objects.Factory.ObjectCurrentlyInCreationException"/> class.
! /// </summary>
! /// <param name="message">
! /// A message about the exception.
! /// </param>
! /// <param name="rootCause">
! /// The root exception that is being wrapped.
! /// </param>
! public ObjectCurrentlyInCreationException(string message, Exception rootCause)
! : base(message, rootCause)
! {
! }
!
! /// <summary>
! /// Creates a new instance of the
! /// <see cref="Spring.Objects.Factory.ObjectCurrentlyInCreationException"/> class.
/// </summary>
/// <param name="message">
/// A message about the exception.
/// </param>
+ /// <param name="objectName">
+ /// The name of the object that triggered the exception.
+ /// </param>
+ public ObjectCurrentlyInCreationException(string objectName, string message)
+ : this(null, objectName, message, null)
+ {
+ }
+
+ /// <summary>
+ /// Creates a new instance of the
+ /// <see cref="Spring.Objects.Factory.ObjectCurrentlyInCreationException"/> class.
+ /// </summary>
+ /// <param name="message">
+ /// A message about the exception.
+ /// </param>
+ /// <param name="objectName">
+ /// The name of the object that triggered the exception.
+ /// </param>
/// <param name="rootCause">
/// The root exception that is being wrapped.
/// </param>
! public ObjectCurrentlyInCreationException(
! string objectName, string message, Exception rootCause)
! : this(null, objectName, message, rootCause)
{
}
! /// <summary>
! /// Creates a new instance of the
! /// <see cref="Spring.Objects.Factory.ObjectCurrentlyInCreationException"/> class.
/// </summary>
! /// <param name="resourceDescription">
! /// The description of the resource associated with the object.
! /// </param>
! /// <param name="message">
! /// A message about the exception.
! /// </param>
! /// <param name="objectName">
/// The name of the object that triggered the exception.
/// </param>
+ public ObjectCurrentlyInCreationException(
+ string resourceDescription,
+ string objectName,
+ string message)
+ : this(resourceDescription, objectName, message, null)
+ {
+ }
+
+ /// <summary>
+ /// Creates a new instance of the
+ /// <see cref="Spring.Objects.Factory.ObjectCurrentlyInCreationException"/> class.
+ /// </summary>
+ /// <param name="resourceDescription">
+ /// The description of the resource associated with the object.
+ /// </param>
/// <param name="message">
/// A message about the exception.
/// </param>
! /// <param name="objectName">
! /// The name of the object that triggered the exception.
! /// </param>
! /// <param name="rootCause">
! /// The root exception that is being wrapped.
! /// </param>
! public ObjectCurrentlyInCreationException(
! string resourceDescription,
! string objectName,
! string message,
! Exception rootCause)
! : base(resourceDescription,
! objectName,
! StringUtils.HasText(message) ? message : "Requested object is currently in creation: Is there an unresolvable circular reference?",
! rootCause)
{
}
|