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
- UserControlBuildProvider.cs
- DataError.cs
- StackSpiller.Temps.cs
- BufferedGraphicsContext.cs
- AudioLevelUpdatedEventArgs.cs
- Hex.cs
- RemoteHelper.cs
- GridErrorDlg.cs
- SqlRowUpdatingEvent.cs
- WebPartMovingEventArgs.cs
- OdbcEnvironment.cs
- BindingCollection.cs
- ImageBrush.cs
- QueryOutputWriter.cs
- DbConnectionFactory.cs
- SelectionProcessor.cs
- SemanticBasicElement.cs
- ErrorFormatter.cs
- ManagedFilter.cs
- CatalogPart.cs
- ToolStripDropTargetManager.cs
- SiteMapNodeCollection.cs
- FixedDocument.cs
- FlowchartSizeFeature.cs
- PassportAuthenticationEventArgs.cs
- BaseTemplatedMobileComponentEditor.cs
- FixedStringLookup.cs
- WbemException.cs
- HostedTransportConfigurationManager.cs
- PageThemeCodeDomTreeGenerator.cs
- CompilationLock.cs
- TimeManager.cs
- ControlTemplate.cs
- RequestDescription.cs
- SafeFindHandle.cs
- BlobPersonalizationState.cs
- ArgIterator.cs
- KnownTypeHelper.cs
- WebPermission.cs
- ScriptRegistrationManager.cs
- NestedContainer.cs
- PingOptions.cs
- KeyTimeConverter.cs
- ZipIOExtraFieldPaddingElement.cs
- ExpressionBuilderContext.cs
- RepeatButton.cs
- DatePicker.cs
- OciEnlistContext.cs
- IssuedSecurityTokenProvider.cs
- RuleInfoComparer.cs
- StreamMarshaler.cs
- FlowDocumentScrollViewer.cs
- WindowHideOrCloseTracker.cs
- ClientRoleProvider.cs
- TextEditorParagraphs.cs
- DoubleStorage.cs
- ApplicationSecurityInfo.cs
- ServiceMemoryGates.cs
- AtomMaterializer.cs
- TreeView.cs
- ListViewUpdatedEventArgs.cs
- ActivityDesignerHelper.cs
- File.cs
- MeasureItemEvent.cs
- Types.cs
- SelectionEditor.cs
- HtmlInputImage.cs
- MobilePage.cs
- VisualStateManager.cs
- UndirectedGraph.cs
- DataGridViewTextBoxCell.cs
- RequestStatusBarUpdateEventArgs.cs
- AttributeData.cs
- DeclarativeCatalogPart.cs
- DataPagerFieldCommandEventArgs.cs
- EnumerableRowCollection.cs
- BindingBase.cs
- MenuItemAutomationPeer.cs
- ChineseLunisolarCalendar.cs
- DesignerDataColumn.cs
- Control.cs
- TrackingStringDictionary.cs
- XPathCompileException.cs
- ResizeGrip.cs
- SignatureToken.cs
- TypeUnloadedException.cs
- Authorization.cs
- XmlNotation.cs
- CircleHotSpot.cs
- FullTextBreakpoint.cs
- EnterpriseServicesHelper.cs
- GridViewRowPresenterBase.cs
- AtomParser.cs
- SQLInt32Storage.cs
- XsltOutput.cs
- NativeMethodsOther.cs
- CodeAttributeArgument.cs
- SuppressMergeCheckAttribute.cs
- OpCellTreeNode.cs
- PriorityItem.cs