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;
64#if !NETSTANDARD2_0 && !NET5_0
92 var sb =
new System.Text.StringBuilder();
93 sb.AppendLine(base.ToString());
96 sb.AppendLine(
"------------------------------");
100 sb.AppendFormat(
"{0}: {1}", error.ExceptionTypeName, error.Message);
101 sb.Append(Environment.NewLine);
102 sb.Append(error.StackTrace);
103 sb.Append(Environment.NewLine);
128 while (result.InnerError !=
null)
134 private object _businessObject;
135 private string _innerStackTrace;
151 get {
return _businessObject; }
154 private Exception _businessException;
169 if (_businessException ==
null)
171 _businessException = this.InnerException;
173 _businessException = _businessException.InnerException;
175 return _businessException;
202 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Globalization",
"CA1305:SpecifyIFormatProvider", MessageId =
"System.String.Format(System.String,System.Object,System.Object,System.Object)")]
205 get {
return String.Format(
"{0}{1}{2}", _innerStackTrace, Environment.NewLine, base.StackTrace); }
213 protected DataPortalException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
214 : base(info, context)
216 _businessObject = info.GetValue(
"_businessObject", typeof(
object));
217 _innerStackTrace = info.GetString(
"_innerStackTrace");
225 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Design",
"CA1062:ValidateArgumentsOfPublicMethods")]
227 [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
228 [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.SerializationFormatter)]
230 public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
232 base.GetObjectData(info, context);
233 info.AddValue(
"_businessObject", _businessObject);
234 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 object.
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 object.
DataPortalException(WcfPortal.WcfErrorInfo info)
Creates an instance of the object.
Exception BusinessException
Gets the original server-side exception.
DataPortalException(string message, Exception ex)
Creates an instance of the object.
DataPortalException(string message, object businessObject)
Creates an instance of the object.
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.