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
- MemberJoinTreeNode.cs
- StyleXamlTreeBuilder.cs
- PenThreadWorker.cs
- BitmapEffectInput.cs
- WindowsFormsHost.cs
- WebPartMenuStyle.cs
- TreeViewDesigner.cs
- WebPart.cs
- CodeArrayCreateExpression.cs
- BrowserCapabilitiesFactory.cs
- PrePrepareMethodAttribute.cs
- EditingCoordinator.cs
- SQLInt32.cs
- CommonProperties.cs
- PointConverter.cs
- HitTestDrawingContextWalker.cs
- SplineKeyFrames.cs
- OleDbErrorCollection.cs
- CompilationAssemblyInstallComponent.cs
- glyphs.cs
- AxParameterData.cs
- EventManager.cs
- NotFiniteNumberException.cs
- Debug.cs
- XPathSingletonIterator.cs
- OrderByExpression.cs
- MatrixTransform3D.cs
- ConnectionStringsSection.cs
- SystemUnicastIPAddressInformation.cs
- ContextMarshalException.cs
- ProvidersHelper.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- ProfileModule.cs
- NumberFunctions.cs
- EventItfInfo.cs
- HwndPanningFeedback.cs
- WebPartActionVerb.cs
- srgsitem.cs
- UIPropertyMetadata.cs
- DbReferenceCollection.cs
- EntitySqlQueryState.cs
- ReferenceConverter.cs
- RSAOAEPKeyExchangeFormatter.cs
- PropertySegmentSerializationProvider.cs
- ShapeTypeface.cs
- ListBindingHelper.cs
- _TransmitFileOverlappedAsyncResult.cs
- CapabilitiesState.cs
- ConvertEvent.cs
- MessageHeaderAttribute.cs
- WmlTextBoxAdapter.cs
- ClientSideProviderDescription.cs
- ProviderException.cs
- AssertSection.cs
- HighlightComponent.cs
- SimpleType.cs
- BinHexDecoder.cs
- PseudoWebRequest.cs
- ParallelTimeline.cs
- SqlDataSourceConnectionPanel.cs
- SqlInternalConnectionTds.cs
- SimpleBitVector32.cs
- PipeStream.cs
- DetectEofStream.cs
- GradientSpreadMethodValidation.cs
- _ContextAwareResult.cs
- ScriptDescriptor.cs
- ConvertEvent.cs
- NamedElement.cs
- Renderer.cs
- EmptyEnumerator.cs
- DataGridViewSelectedColumnCollection.cs
- InputProcessorProfiles.cs
- SiteMembershipCondition.cs
- WindowsFormsSynchronizationContext.cs
- SqlXml.cs
- MobileErrorInfo.cs
- TypedTableBaseExtensions.cs
- DynamicDiscoveryDocument.cs
- ElementHostPropertyMap.cs
- RealProxy.cs
- GenericTextProperties.cs
- BrowserDefinitionCollection.cs
- PrintPreviewGraphics.cs
- QueryOptionExpression.cs
- AutomationElement.cs
- ResourcesGenerator.cs
- GradientSpreadMethodValidation.cs
- DataViewManager.cs
- HwndSourceParameters.cs
- BaseParaClient.cs
- IListConverters.cs
- SQLInt16Storage.cs
- NTAccount.cs
- Point3DCollection.cs
- Control.cs
- DataListItem.cs
- ActivityBindForm.Designer.cs
- HostExecutionContextManager.cs
- SchemaTypeEmitter.cs