protected TableServiceProtocolException(SerializationInfo info, StreamingContext context) : base(info, context) { if (info == null) { throw new ArgumentNullException("info"); } this.StatusEntry = (NephosStatusEntry)info.GetValue("this.StatusEntry", typeof(NephosStatusEntry)); }
public TableServiceProtocolException(NephosStatusEntry statusEntry, Exception innerException) : base((statusEntry != null ? statusEntry.UserMessage : string.Empty), innerException) { if (statusEntry == null) { throw new ArgumentNullException("statusEntry"); } this.StatusEntry = statusEntry; }
static QueueStatusEntries() { QueueStatusEntries.QueueNotFound = new NephosStatusEntry("QueueNotFound", HttpStatusCode.NotFound, "The specified queue does not exist."); QueueStatusEntries.QueueDisabled = new NephosStatusEntry("QueueDisabled", HttpStatusCode.Conflict, "The specified queue is disabled by the administrator."); QueueStatusEntries.QueueAlreadyExists = new NephosStatusEntry("QueueAlreadyExists", HttpStatusCode.Conflict, "The specified queue already exists."); QueueStatusEntries.QueueBeingDeleted = new NephosStatusEntry("QueueBeingDeleted", HttpStatusCode.Conflict, "The specified queue is being deleted."); QueueStatusEntries.QueueNotEmpty = new NephosStatusEntry("QueueNotEmpty", HttpStatusCode.Conflict, "The specified queue is not empty."); QueueStatusEntries.PopReceiptMismatch = new NephosStatusEntry("PopReceiptMismatch", HttpStatusCode.BadRequest, "The specified pop receipt did not match."); QueueStatusEntries.MessageNotFound = new NephosStatusEntry("MessageNotFound", HttpStatusCode.NotFound, "The specified message does not exist."); QueueStatusEntries.MessageTooLarge = new NephosStatusEntry("MessageTooLarge", HttpStatusCode.BadRequest, "The message exceedes the maximum allowed size. The encoded message can be up to 64KB in size for versions 2011-08-18 and newer, or 8KB in size for previous versions."); QueueStatusEntries.InvalidMarker = new NephosStatusEntry("InvalidMarker", HttpStatusCode.BadRequest, "The specified marker is invalid."); }
private static void SerializeXmlError(XmlWriter writer, NephosErrorDetails errorDetails, Exception errorException, bool useVerboseErrors) { NephosStatusEntry statusEntry = errorDetails.StatusEntry; writer.WriteStartElement("error", "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"); XmlErrorResponseWriter.WriteElementString(writer, "code", "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata", statusEntry.StatusId); writer.WriteStartElement("message", "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"); writer.WriteAttributeString("xml", "lang", null, "en-US"); writer.WriteString(errorDetails.UserSafeErrorMessage); writer.WriteEndElement(); if (useVerboseErrors) { XmlErrorResponseWriter.SerializeXmlException(writer, errorException); } writer.WriteEndElement(); }
static TableStatusEntries() { TableStatusEntries.XMethodNotUsingPost = new NephosStatusEntry("XMethodNotUsingPost", HttpStatusCode.BadRequest, "The request uses X-HTTP-Method with a Http Verb that is not POST."); TableStatusEntries.XMethodIncorrectValue = new NephosStatusEntry("XMethodIncorrectValue", HttpStatusCode.BadRequest, "The specified X-HTTP-Method is invalid."); TableStatusEntries.XMethodIncorrectCount = new NephosStatusEntry("XMethodIncorrectCount", HttpStatusCode.BadRequest, "More than one X-HTTP-Method is specified."); TableStatusEntries.TableHasNoProperties = new NephosStatusEntry("TableHasNoProperties", HttpStatusCode.NotFound, "The table has no properties."); TableStatusEntries.DuplicatePropertiesSpecified = new NephosStatusEntry("DuplicatePropertiesSpecified", HttpStatusCode.BadRequest, "A property is specified more than once."); TableStatusEntries.TableHasNoSuchProperty = new NephosStatusEntry("TableHasNoSuchProperty", HttpStatusCode.NotFound, "The property specified is not in the table."); TableStatusEntries.DuplicateKeyPropertySpecified = new NephosStatusEntry("DuplicateKeyPropertySpecified", HttpStatusCode.BadRequest, "A key property is specified more than once."); TableStatusEntries.TableAlreadyExists = new NephosStatusEntry("TableAlreadyExists", HttpStatusCode.Conflict, "The table specified already exists."); TableStatusEntries.TableNotFound = new NephosStatusEntry("TableNotFound", HttpStatusCode.NotFound, "The table specified does not exist."); TableStatusEntries.EntityNotFound = new NephosStatusEntry("EntityNotFound", HttpStatusCode.NotFound, "The specified entity does not exist."); TableStatusEntries.EntityAlreadyExists = new NephosStatusEntry("EntityAlreadyExists", HttpStatusCode.Conflict, "The specified entity already exists."); TableStatusEntries.PartitionKeyNotSpecified = new NephosStatusEntry("PartitionKeyNotSpecified", HttpStatusCode.BadRequest, "The required property 'PartitionKey' is not specified."); TableStatusEntries.OperatorInvalid = new NephosStatusEntry("OperatorInvalid", HttpStatusCode.BadRequest, "The operator specified is invalid."); TableStatusEntries.UpdateConditionNotSatisfied = new NephosStatusEntry("UpdateConditionNotSatisfied", HttpStatusCode.PreconditionFailed, "The update condition specified in the request was not satisfied."); TableStatusEntries.PropertiesNeedValue = new NephosStatusEntry("PropertiesNeedValue", HttpStatusCode.BadRequest, "The values are not specified for all properties in the entity."); TableStatusEntries.PartitionKeyPropertyCannotBeUpdated = new NephosStatusEntry("PartitionKeyPropertyCannotBeUpdated", HttpStatusCode.BadRequest, "The 'PartitionKey' property cannot be udpated."); TableStatusEntries.TooManyProperties = new NephosStatusEntry("TooManyProperties", HttpStatusCode.BadRequest, "The entity contains more properties than allowed. Each entity can include up to 252 properties to store data. Each entity also has 3 system properties."); TableStatusEntries.EntityTooLarge = new NephosStatusEntry("EntityTooLarge", HttpStatusCode.BadRequest, "The entity is larger than the maximum allowed size (1MB)."); TableStatusEntries.PropertyValueTooLarge = new NephosStatusEntry("PropertyValueTooLarge", HttpStatusCode.BadRequest, "The property value exceeds the maximum allowed size (64KB). If the property value is a string, it is UTF-16 encoded and the maximum number of characters should be 32K or less."); TableStatusEntries.PartitionKeyValueTooLarge = new NephosStatusEntry("KeyValueTooLarge", HttpStatusCode.BadRequest, "The 'PartitionKey' property exceeds the maximum allowed key size (2KB). It is a UTF-16 encoded string and the maximum number of characters should be 1K or less."); TableStatusEntries.RowKeyValueTooLarge = new NephosStatusEntry("KeyValueTooLarge", HttpStatusCode.BadRequest, "The 'RowKey' property exceeds the maximum allowed key size (2KB). It is a UTF-16 encoded string and the maximum number of characters should be 1K or less."); TableStatusEntries.InvalidValueType = new NephosStatusEntry("InvalidValueType", HttpStatusCode.BadRequest, "The value specified is invalid."); TableStatusEntries.TableBeingDeleted = new NephosStatusEntry("TableBeingDeleted", HttpStatusCode.Conflict, "The specified table is being deleted. Try operation later."); TableStatusEntries.PropertyNameTooLong = new NephosStatusEntry("PropertyNameTooLong", HttpStatusCode.BadRequest, "The property name exceeds the maximum allowed length (255)."); TableStatusEntries.PropertyNameInvalid = new NephosStatusEntry("PropertyNameInvalid", HttpStatusCode.BadRequest, "The property name is invalid."); TableStatusEntries.CommandsInBatchActOnDifferentPartitions = new NephosStatusEntry("CommandsInBatchActOnDifferentPartitions", HttpStatusCode.BadRequest, "All commands in a batch must operate on same entity group."); TableStatusEntries.InvalidDuplicateRow = new NephosStatusEntry("InvalidDuplicateRow", HttpStatusCode.BadRequest, "The batch request contains multiple changes with same row key. An entity can appear only once in a batch request."); TableStatusEntries.JsonFormatNotSupported = new NephosStatusEntry("JsonFormatNotSupported", HttpStatusCode.UnsupportedMediaType, "JSON format is not supported."); TableStatusEntries.AtomFormatNotSupported = new NephosStatusEntry("AtomFormatNotSupported", HttpStatusCode.UnsupportedMediaType, "Atom format is not supported."); TableStatusEntries.JsonVerboseFormatNotSupported = new NephosStatusEntry("JsonVerboseFormatNotSupported", HttpStatusCode.UnsupportedMediaType, "Verbose JSON format is not supported."); TableStatusEntries.MediaTypeNotSupported = new NephosStatusEntry("MediaTypeNotSupported", HttpStatusCode.UnsupportedMediaType, "None of the provided media types are supported"); TableStatusEntries.MethodNotAllowed = new NephosStatusEntry("MethodNotAllowed", HttpStatusCode.MethodNotAllowed, "The requested method is not allowed on the specified resource."); TableStatusEntries.ContentLengthExceeded = new NephosStatusEntry("ContentLengthExceeded", HttpStatusCode.BadRequest, "The content length for the requested operation has exceeded the limit (4MB)."); TableStatusEntries.AccountIOPSLimitExceeded = new NephosStatusEntry("AccountIOPSLimitExceeded", HttpStatusCode.BadRequest, "The requested IOPS value causes the account IOPS limit to be exceeded"); TableStatusEntries.CannotCreateTableWithIOPSGreaterThanMaxAllowedPerTable = new NephosStatusEntry("CannotCreateTableWithIOPSGreaterThanMaxAllowedPerTable", HttpStatusCode.BadRequest, "The specified IOPS value is more than the allowed limit per table"); TableStatusEntries.TableExceedsPerTableIOPSIncrementLimit = new NephosStatusEntry("PerTableIOPSIncrementLimitReached", HttpStatusCode.Conflict, "The number of IOPS increments for this table has reached the limit"); TableStatusEntries.TableExceedsPerTableIOPSDecrementLimit = new NephosStatusEntry("PerTableIOPSDecrementLimitReached", HttpStatusCode.Conflict, "The number of IOPS decrements for this table has reached the limit"); TableStatusEntries.TableInProvisioningState = new NephosStatusEntry("SetttingIOPSForATableInProvisioningNotAllowed", HttpStatusCode.Conflict, "Cannot change IOPS for a table which is in provisioning state"); TableStatusEntries.PartitionKeyEqualityComparisonExpectedForPremiumTable = new NephosStatusEntry("PartitionKeyEqualityComparisonExpected", HttpStatusCode.BadRequest, "For a premium table, an ordered query filter must be an equality comparison on PartitionKey, optionally combined with an expression using the AND operator"); TableStatusEntries.PartitionKeySpecifiedMoreThanOnceForPremiumTable = new NephosStatusEntry("PartitionKeySpecifiedMoreThanOnce", HttpStatusCode.BadRequest, "For a premium table, an ordered query filter must not refer PartitionKey more than once"); }
static BlobStatusEntries() { BlobStatusEntries.InvalidBlockId = new NephosStatusEntry("InvalidBlockId", HttpStatusCode.BadRequest, "Block ID is invalid. Block ID must be base64 encoded."); BlobStatusEntries.BlobAlreadyExists = new NephosStatusEntry("BlobAlreadyExists", HttpStatusCode.Conflict, "The specified blob already exists."); BlobStatusEntries.BlobWriteProtected = new NephosStatusEntry("BlobWriteProtected", HttpStatusCode.Conflict, "The specified blob is write protected."); BlobStatusEntries.CopySourceCannotBeIncrementalCopyBlob = new NephosStatusEntry("CopySourceCannotBeIncrementalCopyBlob", HttpStatusCode.Conflict, "Source blob of a copy operation cannot be non-snapshot incremental copy blob."); BlobStatusEntries.OperationNotAllowedOnIncrementalCopyBlob = new NephosStatusEntry("OperationNotAllowedOnIncrementalCopyBlob", HttpStatusCode.Conflict, "The specified operation is not allowed on an incremental copy blob."); BlobStatusEntries.IncrementalCopyOfEarlierSnapshotNotAllowed = new NephosStatusEntry("IncrementalCopyOfEarlierSnapshotNotAllowed", HttpStatusCode.Conflict, "The specified snapshot is earlier than the last snapshot copied into the incremental copy blob."); BlobStatusEntries.IncrementalCopyBlobMismatch = new NephosStatusEntry("IncrementalCopyBlobMismatch", HttpStatusCode.Conflict, "The specified source blob is different than the copy source of the existing incremental copy blob."); BlobStatusEntries.IncrementalCopyBlobPreviousSnapshotDoesNotExist = new NephosStatusEntry("IncrementalCopyBlobPreviousSnapshotDoesNotExist", HttpStatusCode.Conflict, "The previously copied source snapshot does not exist."); BlobStatusEntries.LinkBlobCannotBeOverwritten = new NephosStatusEntry("LinkBlobCannotBeOverwritten", HttpStatusCode.Conflict, "Link blob cannot be overwritten."); BlobStatusEntries.LinkBlobCannotBeWriteProtected = new NephosStatusEntry("LinkBlobCannotBeWriteProtected", HttpStatusCode.Conflict, "Link blob cannot be write protected."); BlobStatusEntries.BlobWithSnapshotsCannotBeWriteProtected = new NephosStatusEntry("BlobWithSnapshotsCannotBeWriteProtected", HttpStatusCode.Conflict, "The specified blob has one or more snapshots and cannot be write protected."); BlobStatusEntries.InvalidBlobOrBlock = new NephosStatusEntry("InvalidBlobOrBlock", HttpStatusCode.BadRequest, "The specified blob or block content is invalid."); BlobStatusEntries.InvalidBlockList = new NephosStatusEntry("InvalidBlockList", HttpStatusCode.BadRequest, "The specified block list is invalid."); BlobStatusEntries.InvalidArchiveOperationData = new NephosStatusEntry("InvalidArchiveOperationData", HttpStatusCode.BadRequest, "The specified data either has extra elements, is missing one or more of the necessary elements or the archiveMetadata and/or encryptionKey is not base64 encoded"); BlobStatusEntries.BlobModifiedWhileReading = new NephosStatusEntry("BlobModifiedWhileReading", HttpStatusCode.Conflict, "The blob has been modified while being read."); BlobStatusEntries.LeaseNotPresentWithBlobOperation = new NephosStatusEntry("LeaseNotPresentWithBlobOperation", HttpStatusCode.PreconditionFailed, "There is currently no lease on the blob."); BlobStatusEntries.LeaseNotPresentWithContainerOperation = new NephosStatusEntry("LeaseNotPresentWithContainerOperation", HttpStatusCode.PreconditionFailed, "There is currently no lease on the container."); BlobStatusEntries.LeaseNotPresentWithBlobLeaseOperation = new NephosStatusEntry("LeaseNotPresentWithLeaseOperation", HttpStatusCode.Conflict, "There is currently no lease on the blob."); BlobStatusEntries.LeaseNotPresentWithContainerLeaseOperation = new NephosStatusEntry("LeaseNotPresentWithLeaseOperation", HttpStatusCode.Conflict, "There is currently no lease on the container."); BlobStatusEntries.LeaseLostWithBlobOperation = new NephosStatusEntry("LeaseLost", HttpStatusCode.PreconditionFailed, "A lease ID was specified, but the lease for the blob has expired."); BlobStatusEntries.LeaseLostWithContainerOperation = new NephosStatusEntry("LeaseLost", HttpStatusCode.PreconditionFailed, "A lease ID was specified, but the lease for the container has expired."); BlobStatusEntries.LeaseIdMismatchWithBlobLeaseOperation = new NephosStatusEntry("LeaseIdMismatchWithLeaseOperation", HttpStatusCode.Conflict, "The lease ID specified did not match the lease ID for the blob."); BlobStatusEntries.LeaseIdMismatchWithContainerLeaseOperation = new NephosStatusEntry("LeaseIdMismatchWithLeaseOperation", HttpStatusCode.Conflict, "The lease ID specified did not match the lease ID for the container."); BlobStatusEntries.LeaseIdMismatchWithBlobOperation = new NephosStatusEntry("LeaseIdMismatchWithBlobOperation", HttpStatusCode.PreconditionFailed, "The lease ID specified did not match the lease ID for the blob."); BlobStatusEntries.LeaseIdMismatchWithContainerOperation = new NephosStatusEntry("LeaseIdMismatchWithContainerOperation", HttpStatusCode.PreconditionFailed, "The lease ID specified did not match the lease ID for the container."); BlobStatusEntries.LeaseIdMissingWithBlobOperation = new NephosStatusEntry("LeaseIdMissing", HttpStatusCode.PreconditionFailed, "There is currently a lease on the blob and no lease ID was specified in the request."); BlobStatusEntries.LeaseIdMissingWithContainerOperation = new NephosStatusEntry("LeaseIdMissing", HttpStatusCode.PreconditionFailed, "There is currently a lease on the container and no lease ID was specified in the request."); BlobStatusEntries.LeaseAlreadyPresent = new NephosStatusEntry("LeaseAlreadyPresent", HttpStatusCode.Conflict, "There is already a lease present."); BlobStatusEntries.LeaseAlreadyBroken = new NephosStatusEntry("LeaseAlreadyBroken", HttpStatusCode.Conflict, "The lease has already been broken and cannot be broken again."); BlobStatusEntries.LeaseIsBrokenAndCannotBeRenewed = new NephosStatusEntry("LeaseIsBrokenAndCannotBeRenewed", HttpStatusCode.Conflict, "The lease ID matched, but the lease has been broken explicitly and cannot be renewed."); BlobStatusEntries.LeaseIsBreakingAndCannotBeAcquired = new NephosStatusEntry("LeaseIsBreakingAndCannotBeAcquired", HttpStatusCode.Conflict, "The lease ID matched, but the lease is currently in breaking state and cannot be acquired until it is broken."); BlobStatusEntries.LeaseIsBreakingAndCannotBeChanged = new NephosStatusEntry("LeaseIsBreakingAndCannotBeChanged", HttpStatusCode.Conflict, "The lease ID matched, but the lease is currently in breaking state and cannot be changed."); BlobStatusEntries.InfiniteLeaseDurationRequired = new NephosStatusEntry("InfiniteLeaseDurationRequired", HttpStatusCode.PreconditionFailed, "The lease ID matched, but the specified lease must be an infinite-duration lease."); BlobStatusEntries.SnapshotsPresent = new NephosStatusEntry("SnapshotsPresent", HttpStatusCode.Conflict, "This operation is not permitted because the blob has snapshots."); BlobStatusEntries.InvalidBlobType = new NephosStatusEntry("InvalidBlobType", HttpStatusCode.Conflict, "The blob type is invalid for this operation."); BlobStatusEntries.InvalidVersionForPageBlobOperation = new NephosStatusEntry("InvalidVersionForPageBlobOperation", HttpStatusCode.BadRequest, string.Format("All operations for PageBlob require at least version {0}.", "2009-09-19")); BlobStatusEntries.InvalidVersionForAppendBlobOperation = new NephosStatusEntry("FeatureVersionMismatch", HttpStatusCode.Conflict, string.Format("The operation for AppendBlob requires at least version {0}.", "2015-02-21")); BlobStatusEntries.InvalidVersionForBlobTypeInBlobList = new NephosStatusEntry("FeatureVersionMismatch", HttpStatusCode.Conflict, "The type of a blob in the container is unrecognized by this version."); BlobStatusEntries.InvalidPageRange = new NephosStatusEntry("InvalidPageRange", HttpStatusCode.RequestedRangeNotSatisfiable, "The page range specified is invalid."); BlobStatusEntries.SequenceNumberIncrementTooLarge = new NephosStatusEntry("SequenceNumberIncrementTooLarge", HttpStatusCode.Conflict, "The sequence number increment cannot be performed because it would result in overflow of the sequence number."); BlobStatusEntries.CopyAcrossAccountsNotSupported = new NephosStatusEntry("CopyAcrossAccountsNotSupported", HttpStatusCode.BadRequest, "The copy source account and destination account must be the same."); BlobStatusEntries.AuthorizingCopySourceTimedOut = new NephosStatusEntry("CannotVerifyCopySource", HttpStatusCode.InternalServerError, "Could not verify the copy source within the specified time."); BlobStatusEntries.PendingCopyOperation = new NephosStatusEntry("PendingCopyOperation", HttpStatusCode.Conflict, "There is currently a pending copy operation."); BlobStatusEntries.NoPendingCopyOperation = new NephosStatusEntry("NoPendingCopyOperation", HttpStatusCode.Conflict, "There is currently no pending copy operation."); BlobStatusEntries.CopyIdMismatch = new NephosStatusEntry("CopyIdMismatch", HttpStatusCode.Conflict, "The specified copy ID did not match the copy ID for the pending copy operation."); BlobStatusEntries.IncrementalCopySourceMustBeSnapshot = new NephosStatusEntry("IncrementalCopySourceMustBeSnapshot", HttpStatusCode.Conflict, "The source for incremental copy request must be a snapshot."); BlobStatusEntries.InvalidSourceBlobType = new NephosStatusEntry("InvalidSourceBlobType", HttpStatusCode.Conflict, "The copy source blob type is invalid for this operation."); BlobStatusEntries.InvalidSourceBlobUrl = new NephosStatusEntry("InvalidSourceBlobUrl", HttpStatusCode.Conflict, "The source url for incremental copy request must be valid azure storage blob url."); BlobStatusEntries.AppendPositionConditionNotMet = new NephosStatusEntry("AppendPositionConditionNotMet", HttpStatusCode.PreconditionFailed, "The append position condition specified was not met."); BlobStatusEntries.MaxBlobSizeConditionNotMet = new NephosStatusEntry("MaxBlobSizeConditionNotMet", HttpStatusCode.PreconditionFailed, "The max blob size condition specified was not met."); BlobStatusEntries.BlockCountExceedsLimit = new NephosStatusEntry("BlockCountExceedsLimit", HttpStatusCode.Conflict, "The block count exceeds the maximum permissible limit."); BlobStatusEntries.BlockListTooLong = new NephosStatusEntry("BlockListTooLong", HttpStatusCode.BadRequest, "The block list may not contain more than 50,000 blocks."); BlobStatusEntries.UncommittedBlockCountExceedsLimit = new NephosStatusEntry("BlockCountExceedsLimit", HttpStatusCode.Conflict, "The uncommitted block count cannot exceed the maximum limit of 100,000 blocks."); BlobStatusEntries.May16BlockCountExceedsLimit = new NephosStatusEntry("BlockCountExceedsLimit", HttpStatusCode.Conflict, "The committed block count cannot exceed the maximum limit of 50,000 blocks."); BlobStatusEntries.PreviousSnapshotNotFound = new NephosStatusEntry("PreviousSnapshotNotFound", HttpStatusCode.Conflict, "The previous snapshot is not found."); BlobStatusEntries.DifferentialGetPageRangesNotSupportedOnPreviousSnapshot = new NephosStatusEntry("PreviousSnapshotOperationNotSupported", HttpStatusCode.Conflict, "Differential Get Page Ranges is not supported on the previous snapshot."); BlobStatusEntries.BlobGenerationMismatch = new NephosStatusEntry("BlobGenerationMismatch", HttpStatusCode.Conflict, "The previous snapshot is from a different blob generation."); BlobStatusEntries.BlobOverwritten = new NephosStatusEntry("BlobOverwritten", HttpStatusCode.Conflict, "The blob has been recreated since the previous snapshot was taken."); BlobStatusEntries.PreviousSnapshotCannotBeNewer = new NephosStatusEntry("PreviousSnapshotCannotBeNewer", HttpStatusCode.BadRequest, "The prevsnapshot query parameter value cannot be newer than snapshot query parameter value."); BlobStatusEntries.UnauthorizedBlobOverwrite = new NephosStatusEntry("UnauthorizedBlobOverwrite", HttpStatusCode.Forbidden, "This request is not authorized to perform blob overwrites."); }