9using System.Security.Permissions;
18 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Design",
"CA1032:ImplementStandardExceptionConstructors")]
31 _innerStackTrace = String.Empty;
32 _businessObject = businessObject;
45 _innerStackTrace = ex.StackTrace;
46 _businessObject = businessObject;
61 _innerStackTrace = ex.StackTrace;
80 var sb =
new System.Text.StringBuilder();
81 sb.AppendLine(base.ToString());
84 sb.AppendLine(
"------------------------------");
88 sb.AppendFormat(
"{0}: {1}", error.ExceptionTypeName, error.Message);
89 sb.Append(Environment.NewLine);
90 sb.Append(error.StackTrace);
91 sb.Append(Environment.NewLine);
116 while (result.InnerError !=
null)
122 private object _businessObject;
123 private string _innerStackTrace;
139 get {
return _businessObject; }
142 private Exception _businessException;
157 if (_businessException ==
null)
159 _businessException = this.InnerException;
161 _businessException = _businessException.InnerException;
163 return _businessException;
190 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Globalization",
"CA1305:SpecifyIFormatProvider", MessageId =
"System.String.Format(System.String,System.Object,System.Object,System.Object)")]
193 get {
return String.Format(
"{0}{1}{2}", _innerStackTrace, Environment.NewLine, base.StackTrace); }
201 protected DataPortalException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
202 : base(info, context)
204 _businessObject = info.GetValue(
"_businessObject", typeof(
object));
205 _innerStackTrace = info.GetString(
"_innerStackTrace");
213 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Design",
"CA1062:ValidateArgumentsOfPublicMethods")]
214#if !NET5_0 && !NET6_0
215 [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
216 [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.SerializationFormatter)]
218 public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
220 base.GetObjectData(info, context);
221 info.AddValue(
"_businessObject", _businessObject);
222 info.AddValue(
"_innerStackTrace", _innerStackTrace);
This exception is returned for any errors occurring during the server-side DataPortal invocation.
override string ToString()
Gets a string representation of this object.
override string StackTrace
Get the combined stack trace from the server and client.
DataPortalException(DataPortalErrorInfo info)
Creates an instance of the type.
object BusinessObject
Returns a reference to the business object from the server-side DataPortal.
string BusinessExceptionMessage
Gets the Message property from the BusinessException, falling back to the Message value from the top-...
DataPortalErrorInfo BusinessErrorInfo
Gets the original exception error info that caused this exception.
override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
Serializes the object.
DataPortalErrorInfo ErrorInfo
Gets information about the original server-side exception.
DataPortalException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
Creates an instance of the object for serialization.
DataPortalException(string message, Exception ex, object businessObject)
Creates an instance of the type.
Exception BusinessException
Gets the original server-side exception.
DataPortalException(string message, Exception ex)
Creates an instance of the type.
DataPortalException(string message, object businessObject)
Creates an instance of the type.
override string ToString()
Returns a text representation of this object by returning the GetIdValue value in text form.
This exception is returned from the CallMethod method in the server-side DataPortal and contains the ...
Message containing details about any server-side exception.
string Message
Message from the exception object.
DataPortalErrorInfo InnerError
HttpErrorInfo object containing information about any inner exception of the original exception.
@ Serializable
Prevents updating or inserting until the transaction is complete.