Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Server / System / Data / Services / HandleExceptionArgs.cs / 1305376 / HandleExceptionArgs.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides a class to provide data to the exception handling // process. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services { using System; ///Use this class to customize how exceptions are handled. public class HandleExceptionArgs { #region Private fields. ///Whether the response has already been written out. private readonly bool responseWritten; ///The MIME type used to write the response. private readonly string responseContentType; ///The private Exception exception; ///being handled. Whether a verbose response is appropriate. private bool useVerboseErrors; #endregion Private fields. #region Constructors. ///Initalizes a new /// Theinstance. being handled. /// Whether the response has already been written out. /// The MIME type used to write the response. /// Whether a verbose response is appropriate. internal HandleExceptionArgs(Exception exception, bool responseWritten, string contentType, bool verboseResponse) { this.exception = WebUtil.CheckArgumentNull(exception, "exception"); this.responseWritten = responseWritten; this.responseContentType = contentType; this.useVerboseErrors = verboseResponse; } #endregion Constructors. #region Public properties. /// Gets or sets the ///being handled. This property may be null. public Exception Exception { get { return this.exception; } set { this.exception = value; } } ///Gets the content type for response. public string ResponseContentType { get { return this.responseContentType; } } ///Gets the HTTP status code for the response. public int ResponseStatusCode { get { if (this.exception is DataServiceException) { return ((DataServiceException)this.exception).StatusCode; } else { return 500; // Internal Server Error. } } } ///Gets a value indicating whether the response has already been written out. public bool ResponseWritten { get { return this.responseWritten; } } ///Gets or sets whether a verbose response is appropriate. public bool UseVerboseErrors { get { return this.useVerboseErrors; } set { this.useVerboseErrors = value; } } #endregion Public properties. #region Internal properties. ///The value for the 'Allow' response header. internal string ResponseAllowHeader { get { if (this.exception is DataServiceException) { return ((DataServiceException)this.exception).ResponseAllowHeader; } else { return null; } } } #endregion Internal properties. } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides a class to provide data to the exception handling // process. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services { using System; ///Use this class to customize how exceptions are handled. public class HandleExceptionArgs { #region Private fields. ///Whether the response has already been written out. private readonly bool responseWritten; ///The MIME type used to write the response. private readonly string responseContentType; ///The private Exception exception; ///being handled. Whether a verbose response is appropriate. private bool useVerboseErrors; #endregion Private fields. #region Constructors. ///Initalizes a new /// Theinstance. being handled. /// Whether the response has already been written out. /// The MIME type used to write the response. /// Whether a verbose response is appropriate. internal HandleExceptionArgs(Exception exception, bool responseWritten, string contentType, bool verboseResponse) { this.exception = WebUtil.CheckArgumentNull(exception, "exception"); this.responseWritten = responseWritten; this.responseContentType = contentType; this.useVerboseErrors = verboseResponse; } #endregion Constructors. #region Public properties. /// Gets or sets the ///being handled. This property may be null. public Exception Exception { get { return this.exception; } set { this.exception = value; } } ///Gets the content type for response. public string ResponseContentType { get { return this.responseContentType; } } ///Gets the HTTP status code for the response. public int ResponseStatusCode { get { if (this.exception is DataServiceException) { return ((DataServiceException)this.exception).StatusCode; } else { return 500; // Internal Server Error. } } } ///Gets a value indicating whether the response has already been written out. public bool ResponseWritten { get { return this.responseWritten; } } ///Gets or sets whether a verbose response is appropriate. public bool UseVerboseErrors { get { return this.useVerboseErrors; } set { this.useVerboseErrors = value; } } #endregion Public properties. #region Internal properties. ///The value for the 'Allow' response header. internal string ResponseAllowHeader { get { if (this.exception is DataServiceException) { return ((DataServiceException)this.exception).ResponseAllowHeader; } else { return null; } } } #endregion Internal properties. } } // 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
- Point3DAnimation.cs
- SqlBuffer.cs
- ListSortDescription.cs
- ServicePointManagerElement.cs
- Relationship.cs
- ToolBarPanel.cs
- InputScope.cs
- ToolStripDropTargetManager.cs
- ProxyGenerationError.cs
- SerialReceived.cs
- Graphics.cs
- QueryTaskGroupState.cs
- ReliabilityContractAttribute.cs
- HtmlHead.cs
- ColorAnimationUsingKeyFrames.cs
- Attributes.cs
- SubpageParagraph.cs
- ConstraintManager.cs
- MediaTimeline.cs
- DetailsViewInsertedEventArgs.cs
- KnownTypeDataContractResolver.cs
- ItemList.cs
- CategoriesDocument.cs
- FormViewInsertedEventArgs.cs
- MappingItemCollection.cs
- CodeCommentStatementCollection.cs
- PropertyItem.cs
- BufferedStream2.cs
- TypeDescriptorContext.cs
- TracePayload.cs
- SelectionWordBreaker.cs
- MonitoringDescriptionAttribute.cs
- CommandEventArgs.cs
- PointAnimationUsingPath.cs
- PrinterUnitConvert.cs
- RegexEditorDialog.cs
- ZoneMembershipCondition.cs
- LinkedResourceCollection.cs
- HtmlLink.cs
- WorkflowOwnershipException.cs
- Stopwatch.cs
- FlatButtonAppearance.cs
- FileCodeGroup.cs
- COM2PropertyDescriptor.cs
- UnionCodeGroup.cs
- HiddenFieldPageStatePersister.cs
- VideoDrawing.cs
- VBCodeProvider.cs
- AccessDataSourceView.cs
- WebScriptMetadataMessageEncodingBindingElement.cs
- PositiveTimeSpanValidatorAttribute.cs
- LogWriteRestartAreaState.cs
- TransportContext.cs
- RsaKeyGen.cs
- ValueUnavailableException.cs
- CatalogZoneBase.cs
- OleDbConnectionFactory.cs
- Perspective.cs
- CalendarDay.cs
- WebPartCatalogCloseVerb.cs
- DataAccessor.cs
- MarshalByRefObject.cs
- Evidence.cs
- XmlSchemaAny.cs
- CqlWriter.cs
- FormsAuthenticationTicket.cs
- AuthenticationConfig.cs
- InstanceCollisionException.cs
- securitycriticaldataClass.cs
- RegistryKey.cs
- SingleObjectCollection.cs
- ConfigurationStrings.cs
- PaperSource.cs
- XPathNavigatorKeyComparer.cs
- NotificationContext.cs
- ContextBase.cs
- TreeWalker.cs
- WasNotInstalledException.cs
- TreeBuilderBamlTranslator.cs
- HMACSHA256.cs
- figurelength.cs
- AnnotationService.cs
- EventLevel.cs
- PasswordRecoveryDesigner.cs
- DataSourceXmlSerializationAttribute.cs
- FlowDocumentView.cs
- LambdaCompiler.Expressions.cs
- HealthMonitoringSectionHelper.cs
- TableLayout.cs
- ProcessingInstructionAction.cs
- BaseConfigurationRecord.cs
- DictionaryItemsCollection.cs
- BypassElementCollection.cs
- exports.cs
- StringUtil.cs
- ObjectCacheHost.cs
- HwndSourceKeyboardInputSite.cs
- PasswordRecovery.cs
- InternalBase.cs
- LocatorBase.cs