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
- ControlBuilderAttribute.cs
- PeerUnsafeNativeCryptMethods.cs
- GeneralTransform2DTo3D.cs
- ClientFormsAuthenticationMembershipProvider.cs
- VerificationAttribute.cs
- LocalizedNameDescriptionPair.cs
- PackageProperties.cs
- TextRangeSerialization.cs
- ListViewPagedDataSource.cs
- TableStyle.cs
- TypeBuilder.cs
- RawStylusSystemGestureInputReport.cs
- DataListItemEventArgs.cs
- InternalPermissions.cs
- DecryptRequest.cs
- FontFamily.cs
- DisplayInformation.cs
- smtppermission.cs
- GlobalEventManager.cs
- DataGridViewSortCompareEventArgs.cs
- ApplicationServiceHelper.cs
- RequestContext.cs
- ObjectTypeMapping.cs
- SvcMapFileLoader.cs
- SimpleTextLine.cs
- figurelengthconverter.cs
- ToolStripRenderEventArgs.cs
- DBSchemaRow.cs
- HostingEnvironmentSection.cs
- XpsFilter.cs
- TheQuery.cs
- cookiecollection.cs
- ConditionedDesigner.cs
- BitStack.cs
- XmlTextWriter.cs
- CfgParser.cs
- ObjectDataSourceView.cs
- ProtocolViolationException.cs
- RSAProtectedConfigurationProvider.cs
- SizeConverter.cs
- IndividualDeviceConfig.cs
- StyleXamlParser.cs
- MethodExecutor.cs
- FontUnit.cs
- objectquery_tresulttype.cs
- Vector.cs
- DynamicValueConverter.cs
- DashStyles.cs
- ForeignConstraint.cs
- EntityViewContainer.cs
- CatalogPartDesigner.cs
- WebPartEditVerb.cs
- _NTAuthentication.cs
- TriggerActionCollection.cs
- TakeOrSkipWhileQueryOperator.cs
- QilFunction.cs
- MULTI_QI.cs
- HwndStylusInputProvider.cs
- CellParaClient.cs
- CacheOutputQuery.cs
- PathSegment.cs
- ComplexType.cs
- FileDetails.cs
- XmlTextEncoder.cs
- FramingDecoders.cs
- Exception.cs
- IPAddressCollection.cs
- TrackPoint.cs
- DataGridRelationshipRow.cs
- BooleanConverter.cs
- SQLGuidStorage.cs
- DiscardableAttribute.cs
- ContentDisposition.cs
- Graphics.cs
- PauseStoryboard.cs
- WebCategoryAttribute.cs
- XmlDocumentFragment.cs
- MediaCommands.cs
- BitmapScalingModeValidation.cs
- WrappedReader.cs
- LinkDescriptor.cs
- ErrorFormatterPage.cs
- NamespaceInfo.cs
- SequenceDesignerAccessibleObject.cs
- InputLangChangeEvent.cs
- BrowserCapabilitiesFactory.cs
- XmlHierarchyData.cs
- Span.cs
- CompressStream.cs
- PageVisual.cs
- TriggerActionCollection.cs
- RawStylusInput.cs
- WebException.cs
- ColumnMapCopier.cs
- SymmetricKey.cs
- ToolStripPanel.cs
- _AutoWebProxyScriptHelper.cs
- ExtendedPropertyInfo.cs
- QilUnary.cs
- TemplatedWizardStep.cs