You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by gb...@apache.org on 2005/05/05 20:51:50 UTC
svn commit: r168383 -
/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ErrorContext.cs
Author: gbayon
Date: Thu May 5 11:51:50 2005
New Revision: 168383
URL: http://svn.apache.org/viewcvs?rev=168383&view=rev
Log:
- Fixed JIRA IBATISNET-52
Modified:
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ErrorContext.cs
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ErrorContext.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ErrorContext.cs?rev=168383&r1=168382&r2=168383&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ErrorContext.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ErrorContext.cs Thu May 5 11:51:50 2005
@@ -25,7 +25,7 @@
#endregion
#region Using
-using System;
+
using System.Text;
#endregion
@@ -40,10 +40,10 @@
#region Fields
- private string _resource;
- private string _activity;
- private string _objectId;
- private string _moreInfo;
+ private string _resource = string.Empty;
+ private string _activity = string.Empty;
+ private string _objectId = string.Empty;
+ private string _moreInfo = string.Empty;
#endregion
#region Properties
@@ -106,7 +106,7 @@
StringBuilder message = new StringBuilder();
// activity
- if (_activity != null)
+ if (_activity != null && _activity.Length > 0)
{
message.Append("\n- The error occurred while ");
message.Append(_activity);
@@ -114,14 +114,14 @@
}
// more info
- if (_moreInfo != null)
+ if (_moreInfo != null && _moreInfo.Length > 0)
{
message.Append("\n- ");
message.Append(_moreInfo);
}
// resource
- if (_resource != null)
+ if (_resource != null && _resource.Length > 0)
{
message.Append("\n- The error occurred in ");
message.Append(_resource);
@@ -129,19 +129,12 @@
}
// object
- if (_objectId != null)
+ if (_objectId != null && _objectId.Length > 0)
{
message.Append(" \n- Check the ");
message.Append(_objectId);
message.Append(".");
}
-
-// // cause
-// if (_cause != null)
-// {
-// message.Append("\n- Cause: ");
-// message.Append(_cause.ToString());
-// }
return message.ToString();
}