/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * Kind, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ using System; namespace PortCMIS.Exceptions { /// /// Base exception for all CMIS exceptions. /// public abstract class CmisBaseException : Exception { /// /// Constructor. /// public CmisBaseException() : base() { Code = null; } /// /// Constructor. /// The exception message. /// public CmisBaseException(string message) : base(message) { Code = null; } /// /// Constructor. /// The exception message. /// The inner exception. /// public CmisBaseException(string message, Exception inner) : base(message, inner) { Code = null; } /// /// Constructor. /// The exception message. /// The exception code. (Web Services only.) /// public CmisBaseException(string message, long? code) : this(message) { Code = code; } /// /// Constructor. /// The exception message. /// The error content /// public CmisBaseException(string message, string errorContent) : this(message) { ErrorContent = errorContent; } /// /// Constructor. /// The exception message. /// The error content /// The inner exception. /// public CmisBaseException(string message, string errorContent, Exception inner) : this(message, inner) { ErrorContent = errorContent; } /// /// The exception code. /// /// Only used by the Web Services binding. /// The exception code. public long? Code { get; protected set; } /// /// The unparsed error message. /// /// The unparsed error message. public string ErrorContent { get; protected set; } /// /// The CMIS exception name /// public abstract string Name { get; } } /// /// Connection exception. /// public class CmisConnectionException : CmisBaseException { /// /// Constructor. /// public CmisConnectionException() : base() { } /// /// Constructor. /// public CmisConnectionException(string message) : base(message) { } /// /// Constructor. /// public CmisConnectionException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisConnectionException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisConnectionException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisConnectionException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } /// The CMIS exception name public const string ExceptionName = "connection"; /// public override string Name { get { return ExceptionName; } } } /// /// Constraint exception. /// public class CmisConstraintException : CmisBaseException { /// /// Constructor. /// public CmisConstraintException() : base() { } /// /// Constructor. /// public CmisConstraintException(string message) : base(message) { } /// /// Constructor. /// public CmisConstraintException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisConstraintException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisConstraintException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisConstraintException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } /// The CMIS exception name public const string ExceptionName = "constraint"; /// public override string Name { get { return ExceptionName; } } } /// /// Content Already Exists exception. /// public class CmisContentAlreadyExistsException : CmisBaseException { /// /// Constructor. /// public CmisContentAlreadyExistsException() : base() { } /// /// Constructor. /// public CmisContentAlreadyExistsException(string message) : base(message) { } /// /// Constructor. /// public CmisContentAlreadyExistsException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisContentAlreadyExistsException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisContentAlreadyExistsException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisContentAlreadyExistsException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } /// The CMIS exception name public const string ExceptionName = "contentAlreadyExists"; /// public override string Name { get { return ExceptionName; } } } /// /// Filter Not Valid exception. /// public class CmisFilterNotValidException : CmisBaseException { /// /// Constructor. /// public CmisFilterNotValidException() : base() { } /// /// Constructor. /// public CmisFilterNotValidException(string message) : base(message) { } /// /// Constructor. /// public CmisFilterNotValidException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisFilterNotValidException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisFilterNotValidException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisFilterNotValidException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } /// The CMIS exception name public const string ExceptionName = "filterNotValid"; /// public override string Name { get { return ExceptionName; } } } /// /// Invalid Argument exception. /// public class CmisInvalidArgumentException : CmisBaseException { /// /// Constructor. /// public CmisInvalidArgumentException() : base() { } /// /// Constructor. /// public CmisInvalidArgumentException(string message) : base(message) { } /// /// Constructor. /// public CmisInvalidArgumentException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisInvalidArgumentException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisInvalidArgumentException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisInvalidArgumentException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } /// The CMIS exception name public const string ExceptionName = "invalidArgument"; /// public override string Name { get { return ExceptionName; } } } /// /// Name Constraint Violation exception. /// public class CmisNameConstraintViolationException : CmisBaseException { /// /// Constructor. /// public CmisNameConstraintViolationException() : base() { } /// /// Constructor. /// public CmisNameConstraintViolationException(string message) : base(message) { } /// /// Constructor. /// public CmisNameConstraintViolationException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisNameConstraintViolationException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisNameConstraintViolationException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisNameConstraintViolationException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } /// The CMIS exception name public const string ExceptionName = "nameConstraintViolation"; /// public override string Name { get { return ExceptionName; } } } /// /// Not Supported exception. /// public class CmisNotSupportedException : CmisBaseException { /// /// Constructor. /// public CmisNotSupportedException() : base() { } /// /// Constructor. /// public CmisNotSupportedException(string message) : base(message) { } /// /// Constructor. /// public CmisNotSupportedException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisNotSupportedException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisNotSupportedException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisNotSupportedException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } /// The CMIS exception name public const string ExceptionName = "notSupported"; /// public override string Name { get { return ExceptionName; } } } /// /// Object Not Found exception. /// public class CmisObjectNotFoundException : CmisBaseException { /// /// Constructor. /// public CmisObjectNotFoundException() : base() { } /// /// Constructor. /// public CmisObjectNotFoundException(string message) : base(message) { } /// /// Constructor. /// public CmisObjectNotFoundException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisObjectNotFoundException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisObjectNotFoundException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisObjectNotFoundException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } /// The CMIS exception name public const string ExceptionName = "objectNotFound"; /// public override string Name { get { return ExceptionName; } } } /// /// Permission Denied exception. /// public class CmisPermissionDeniedException : CmisBaseException { /// /// Constructor. /// public CmisPermissionDeniedException() : base() { } /// /// Constructor. /// public CmisPermissionDeniedException(string message) : base(message) { } /// /// Constructor. /// public CmisPermissionDeniedException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisPermissionDeniedException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisPermissionDeniedException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisPermissionDeniedException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } /// The CMIS exception name public const string ExceptionName = "permissionDenied"; /// public override string Name { get { return ExceptionName; } } } /// /// Runtime exception. /// public class CmisRuntimeException : CmisBaseException { /// /// Constructor. /// public CmisRuntimeException() : base() { } /// /// Constructor. /// public CmisRuntimeException(string message) : base(message) { } /// /// Constructor. /// public CmisRuntimeException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisRuntimeException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisRuntimeException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisRuntimeException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } /// The CMIS exception name public const string ExceptionName = "runtime"; /// public override string Name { get { return ExceptionName; } } } /// /// Storage exception. /// public class CmisStorageException : CmisBaseException { /// /// Constructor. /// public CmisStorageException() : base() { } /// /// Constructor. /// public CmisStorageException(string message) : base(message) { } /// /// Constructor. /// public CmisStorageException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisStorageException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisStorageException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisStorageException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } /// The CMIS exception name public const string ExceptionName = "storage"; /// public override string Name { get { return ExceptionName; } } } /// /// Stream Not Supported exception. /// public class CmisStreamNotSupportedException : CmisBaseException { /// /// Constructor. /// public CmisStreamNotSupportedException() : base() { } /// /// Constructor. /// public CmisStreamNotSupportedException(string message) : base(message) { } /// /// Constructor. /// public CmisStreamNotSupportedException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisStreamNotSupportedException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisStreamNotSupportedException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisStreamNotSupportedException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } /// The CMIS exception name public const string ExceptionName = "streamNotSupported"; /// public override string Name { get { return ExceptionName; } } } /// /// Update Conflict exception. /// public class CmisUpdateConflictException : CmisBaseException { /// /// Constructor. /// public CmisUpdateConflictException() : base() { } /// /// Constructor. /// public CmisUpdateConflictException(string message) : base(message) { } /// /// Constructor. /// public CmisUpdateConflictException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisUpdateConflictException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisUpdateConflictException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisUpdateConflictException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } /// The CMIS exception name public const string ExceptionName = "updateConflict"; /// public override string Name { get { return ExceptionName; } } } /// /// Versioning exception. /// public class CmisVersioningException : CmisBaseException { /// /// Constructor. /// public CmisVersioningException() : base() { } /// /// Constructor. /// public CmisVersioningException(string message) : base(message) { } /// /// Constructor. /// public CmisVersioningException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisVersioningException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisVersioningException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisVersioningException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } /// The CMIS exception name public const string ExceptionName = "versioning"; /// public override string Name { get { return ExceptionName; } } } /// /// Unauthorized exception. /// public class CmisUnauthorizedException : CmisRuntimeException { /// /// Constructor. /// public CmisUnauthorizedException() : base() { } /// /// Constructor. /// public CmisUnauthorizedException(string message) : base(message) { } /// /// Constructor. /// public CmisUnauthorizedException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisUnauthorizedException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisUnauthorizedException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisUnauthorizedException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } } /// /// Proxy Authentication exception. /// public class CmisProxyAuthenticationException : CmisRuntimeException { /// /// Constructor. /// public CmisProxyAuthenticationException() : base() { } /// /// Constructor. /// public CmisProxyAuthenticationException(string message) : base(message) { } /// /// Constructor. /// public CmisProxyAuthenticationException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisProxyAuthenticationException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisProxyAuthenticationException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisProxyAuthenticationException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } } /// /// Service Unavailable exception. /// public class CmisServiceUnavailableException : CmisRuntimeException { /// /// Constructor. /// public CmisServiceUnavailableException() : base() { } /// /// Constructor. /// public CmisServiceUnavailableException(string message) : base(message) { } /// /// Constructor. /// public CmisServiceUnavailableException(string message, Exception inner) : base(message, inner) { } /// /// Constructor. /// public CmisServiceUnavailableException(string message, long? code) : base(message) { } /// /// Constructor. /// public CmisServiceUnavailableException(string message, string errorContent) : base(message) { } /// /// Constructor. /// public CmisServiceUnavailableException(string message, string errorContent, Exception inner) : base(message, errorContent, inner) { } } /// /// Invalid Server Data exception. /// public class CmisInvalidServerData : InvalidOperationException { /// /// Constructor. /// public CmisInvalidServerData() : base() { } /// /// Constructor. /// public CmisInvalidServerData(string message) : base(message) { } /// /// Constructor. /// public CmisInvalidServerData(string message, Exception inner) : base(message, inner) { } } }