Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx35 / System.WorkflowServices / System / ServiceModel / Dispatcher / DurableErrorHandler.cs / 1305376 / DurableErrorHandler.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Dispatcher { using System.ServiceModel.Channels; using System.Diagnostics.CodeAnalysis; abstract class DurableErrorHandler : IErrorHandler { bool debug; public DurableErrorHandler(bool debug) { this.debug = debug; } public static void CleanUpInstanceContextAtOperationCompletion() { if (OperationContext.Current == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR2.NoOperationContext)); } DurableMessageDispatchInspector.SuppressContextOnReply(OperationContext.Current); OperationContext.Current.InstanceContext.IncomingChannels.Clear(); } public bool HandleError(Exception error) { return IsUserCodeException(error); } [SuppressMessage("Microsoft.Globalization", "CA1304")] public void ProvideFault(Exception error, MessageVersion version, ref Message fault) { if (fault == null && IsUserCodeException(error)) { FaultCode code = new FaultCode(FaultCodeConstants.Codes.InternalServiceFault, FaultCodeConstants.Namespaces.NetDispatch); code = FaultCode.CreateReceiverFaultCode(code); string action = FaultCodeConstants.Actions.NetDispatcher; MessageFault messageFault; if (this.debug) { Exception toTrace = GetExceptionToTrace(error); messageFault = MessageFault.CreateFault(code, new FaultReason(toTrace.Message), new ExceptionDetail(toTrace)); } else { string reason = SR.GetString(SR.SFxInternalServerError); messageFault = MessageFault.CreateFault(code, new FaultReason(reason)); } fault = Message.CreateMessage(version, messageFault, action); } } protected virtual Exception GetExceptionToTrace(Exception error) { return error; } protected abstract bool IsUserCodeException(Exception error); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TransformCollection.cs
- StringSorter.cs
- JsonDeserializer.cs
- UIPermission.cs
- ConstraintConverter.cs
- ConnectionConsumerAttribute.cs
- OdbcDataReader.cs
- PropertyEntry.cs
- DeflateStream.cs
- ColorConvertedBitmap.cs
- VersionUtil.cs
- InvariantComparer.cs
- COM2ExtendedTypeConverter.cs
- DynamicHyperLink.cs
- ProjectionPruner.cs
- URIFormatException.cs
- PrtTicket_Editor.cs
- TimelineGroup.cs
- XmlMemberMapping.cs
- LostFocusEventManager.cs
- DataControlField.cs
- RemotingConfigParser.cs
- NotFiniteNumberException.cs
- BitmapPalette.cs
- DiscoveryClientElement.cs
- TableCell.cs
- ErasingStroke.cs
- DocumentOrderComparer.cs
- ModelItemDictionaryImpl.cs
- ResXResourceSet.cs
- TreeViewItemAutomationPeer.cs
- ResponseStream.cs
- BamlRecordHelper.cs
- ShaderEffect.cs
- ValidationResult.cs
- ExpressionBindingCollection.cs
- EmptyEnumerator.cs
- JournalEntryStack.cs
- ToolStripItemImageRenderEventArgs.cs
- SpellerHighlightLayer.cs
- RepeatInfo.cs
- XmlSchemaException.cs
- BasicHttpBindingElement.cs
- LocatorGroup.cs
- DSASignatureDeformatter.cs
- TransformerTypeCollection.cs
- DodSequenceMerge.cs
- TdsValueSetter.cs
- DesignerCalendarAdapter.cs
- DirectoryRootQuery.cs
- SerializationEventsCache.cs
- BufferedWebEventProvider.cs
- PasswordTextContainer.cs
- WindowsSidIdentity.cs
- TableParaClient.cs
- EventMappingSettingsCollection.cs
- Exceptions.cs
- SqlNodeTypeOperators.cs
- TcpWorkerProcess.cs
- DataGridViewCellCancelEventArgs.cs
- BasicKeyConstraint.cs
- CreateUserWizardStep.cs
- FilterableAttribute.cs
- EnumBuilder.cs
- ResourceManager.cs
- ResourceManager.cs
- Point4D.cs
- TypedReference.cs
- FixedStringLookup.cs
- Image.cs
- ProviderIncompatibleException.cs
- MessageEncodingBindingElement.cs
- MultipleViewPattern.cs
- ColumnClickEvent.cs
- ToolStripDropDownMenu.cs
- ResourceReferenceExpression.cs
- IisTraceListener.cs
- DbModificationCommandTree.cs
- DomainLiteralReader.cs
- WeakEventTable.cs
- WSHttpBindingCollectionElement.cs
- X509Extension.cs
- RemotingConfigParser.cs
- HttpApplication.cs
- UICuesEvent.cs
- CatalogPartChrome.cs
- PointConverter.cs
- SourceFileInfo.cs
- PartitionResolver.cs
- activationcontext.cs
- WindowInteractionStateTracker.cs
- Parallel.cs
- FormViewDeletedEventArgs.cs
- ReaderWriterLockWrapper.cs
- XmlWriterDelegator.cs
- securitycriticaldataClass.cs
- Pkcs9Attribute.cs
- DecimalAnimationBase.cs
- ThemeInfoAttribute.cs
- ProvideValueServiceProvider.cs