Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / ExceptionDetail.cs / 1 / ExceptionDetail.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel { using System; using System.Globalization; using System.Text; using System.Runtime.Serialization; [DataContract] public class ExceptionDetail { string helpLink; ExceptionDetail innerException; string message; string stackTrace; string type; public ExceptionDetail(Exception exception) { if (exception == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("exception"); } this.helpLink = exception.HelpLink; this.message = exception.Message; this.stackTrace = exception.StackTrace; this.type = exception.GetType().ToString(); if (exception.InnerException != null) { this.innerException = new ExceptionDetail(exception.InnerException); } } [DataMember] public string HelpLink { get { return this.helpLink; } private set { this.helpLink = value; } } [DataMember] public ExceptionDetail InnerException { get { return this.innerException; } private set { this.innerException = value; } } [DataMember] public string Message { get { return this.message; } private set { this.message = value; } } [DataMember] public string StackTrace { get { return this.stackTrace; } private set { this.stackTrace = value; } } [DataMember] public string Type { get { return this.type; } private set { this.type = value; } } public override string ToString() { return string.Format(CultureInfo.InvariantCulture, "{0}\n{1}", SR.GetString(SR.SFxExceptionDetailFormat), this.ToStringHelper(false)); } string ToStringHelper(bool isInner) { StringBuilder sb = new StringBuilder(); sb.AppendFormat("{0}: {1}", this.Type, this.Message); if (this.InnerException != null) { sb.AppendFormat(" ----> {0}", this.InnerException.ToStringHelper(true)); } else { sb.Append("\n"); } sb.Append(this.StackTrace); if (isInner) { sb.AppendFormat("\n {0}\n", SR.GetString(SR.SFxExceptionDetailEndOfInner)); } return sb.ToString(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Icon.cs
- IPAddress.cs
- DataGridViewHeaderCell.cs
- BindingList.cs
- PngBitmapEncoder.cs
- XmlQualifiedNameTest.cs
- HttpModuleAction.cs
- EntityDataSourceStatementEditor.cs
- OleDbDataAdapter.cs
- FamilyCollection.cs
- Substitution.cs
- LinkUtilities.cs
- TraceHandlerErrorFormatter.cs
- BitStream.cs
- TypeRestriction.cs
- ColorAnimationBase.cs
- DataGridAddNewRow.cs
- HtmlElementErrorEventArgs.cs
- WindowsSecurityTokenAuthenticator.cs
- BinaryNode.cs
- xdrvalidator.cs
- Pair.cs
- PolygonHotSpot.cs
- BatchServiceHost.cs
- DomainConstraint.cs
- DataBoundControlAdapter.cs
- TableAdapterManagerNameHandler.cs
- Span.cs
- NativeMethods.cs
- MDIClient.cs
- DataGridToolTip.cs
- WebServiceData.cs
- WithParamAction.cs
- CorrelationManager.cs
- TextSelection.cs
- IdentityHolder.cs
- ConfigXmlSignificantWhitespace.cs
- NavigationEventArgs.cs
- ProcessThreadCollection.cs
- ApplicationInfo.cs
- MimeTypeMapper.cs
- IntersectQueryOperator.cs
- ReadOnlyAttribute.cs
- ParseElement.cs
- LocatorManager.cs
- MaterialGroup.cs
- Predicate.cs
- ToolStripDropDownMenu.cs
- AccessibleObject.cs
- ViewBase.cs
- SecureEnvironment.cs
- QilChoice.cs
- IdleTimeoutMonitor.cs
- Container.cs
- IPAddressCollection.cs
- wmiprovider.cs
- PlaceHolder.cs
- AndMessageFilterTable.cs
- ComponentChangingEvent.cs
- DependencyObject.cs
- Crc32Helper.cs
- XmlMapping.cs
- SmiEventSink_DeferedProcessing.cs
- GroupBox.cs
- EntityFrameworkVersions.cs
- ManagedWndProcTracker.cs
- Hashtable.cs
- EntityUtil.cs
- CodeSnippetCompileUnit.cs
- AttributeCollection.cs
- ArrayListCollectionBase.cs
- BevelBitmapEffect.cs
- UpdateRecord.cs
- WmpBitmapDecoder.cs
- StylusButton.cs
- IWorkflowDebuggerService.cs
- KeyToListMap.cs
- TimeSpanMinutesConverter.cs
- DatePicker.cs
- TrackingProfileManager.cs
- DataSpaceManager.cs
- XdrBuilder.cs
- DocumentViewer.cs
- FederatedMessageSecurityOverHttp.cs
- InternalConfigEventArgs.cs
- ChtmlTextWriter.cs
- MouseButton.cs
- ModelItemCollection.cs
- Filter.cs
- SoapInteropTypes.cs
- Vector3DIndependentAnimationStorage.cs
- ValueUtilsSmi.cs
- _Rfc2616CacheValidators.cs
- SmiContext.cs
- PropertyCollection.cs
- DelegatingTypeDescriptionProvider.cs
- FixedTextPointer.cs
- StaticContext.cs
- ThrowHelper.cs
- Subtree.cs