Rest error codes

Blob service error codes

This page is created from HTTP status code information found at ietf. Click on the category heading or the status code link to read more. This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. There are no required headers for this class of status code. A client MUST be prepared to accept one or more 1xx status responses prior to a regular response, even if the client does not expect a Continue status message. Unexpected 1xx status responses MAY be ignored by a user agent. Proxies MUST forward 1xx responses, unless the connection between the proxy and its client has been closed, or unless the proxy itself requested the generation of the 1xx response. For example, if a proxy adds a "Expect: continue" field when it forwards a request, then it need not forward the corresponding Continue response s. This interim response is used to inform the client that the initial part of the request has been received and has not yet been rejected by the server. The client SHOULD continue by sending the remainder of the request or, if the request has already been completed, ignore this response. The server MUST send a final response after the request has been completed. See section 8. This means that the server has received the request headers, and that the client should proceed to send the request body in the case of a request for which a body needs to be sent; for example, a POST request. If the request body is large, sending it to a server when a request has already been rejected based upon inappropriate headers is inefficient. To have a server check if the request could be accepted based on the request's headers alone, a client must send Expect: continue as a header in its initial request and check if a Continue status code is received in response before continuing or receive Expectation Failed and not continue. The server understands and is willing to comply with the client's request, via the Upgrade message header field section The server will switch protocols to those defined by the response's Upgrade header field immediately after the empty line which terminates the response. For example, switching to a newer version of HTTP is advantageous over older versions, and switching to a real-time, synchronous protocol might be advantageous when delivering resources that use such features. This means the requester has asked the server to switch protocols and the server is acknowledging that it will do so. The Processing status code is an interim response used to inform the client that the server has accepted the complete request, but has not yet completed it. This status code SHOULD only be sent when the server has a reasonable expectation that the request will take significant time to complete. As guidance, if a method is taking longer than 20 seconds a reasonable, but arbitrary value to process the server SHOULD return a Processing response. Methods can potentially take a long period of time to process, especially methods that support the Depth header. In such cases the client may time-out the connection while waiting for a response. To prevent this the server may return a Processing status code to indicate to the client that the server is still processing the method. As a WebDAV request may contain many sub-requests involving file operations, it may take a long time to complete the request. This code indicates that the server has received and is processing the request, but no response is available yet. This prevents the client from timing out and assuming the request was lost. This class of status code indicates that the client's request was successfully received, understood, and accepted. This class of status codes indicates the action requested by the client was received, understood, accepted and processed successfully. The request has succeeded. The information returned with the response is dependent on the method used in the request, for example: GET an entity corresponding to the requested resource is sent in the response; HEAD the entity-header fields corresponding to the requested resource are sent in the response without any message-body; POST an entity describing or containing the result of the action; TRACE an entity containing the request message as received by the end server. Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource.

List of HTTP status codes


The error codes listed in the following table may be returned by an operation against the Blob service. Skip to main content. Exit focus mode. BlobAlreadyExists Conflict The specified blob already exists. BlobOverwritten Conflict The blob has been recreated since the previous snapshot was taken. BlockCountExceedsLimit Conflict The committed block count cannot exceed the maximum limit of 50, blocks. BlockCountExceedsLimit Conflict The uncommitted block count cannot exceed the maximum limit ofblocks. Examine the HTTP status code and message for more information about the failure. ContainerAlreadyExists Conflict The specified container already exists. ContainerBeingDeleted Conflict The specified container is being deleted. ContainerDisabled Conflict The specified container has been disabled by the administrator. FeatureVersionMismatch Conflict The type of blob in the container is unrecognized by this version. IncrementalCopyBlobMismatch Conflict The specified source blob is different than the copy source of the existing incremental copy blob. InvalidBlobType Conflict The blob type is invalid for this operation. The block ID must be Baseencoded. InvalidOperation Bad Request Invalid operation against a blob snapshot. LeaseAlreadyPresent Conflict There is already a lease present. LeaseAlreadyBroken Conflict The lease has already been broken and cannot be broken again. PendingCopyOperation Conflict There is currently a pending copy operation. PreviousSnapshotCannotBeNewer Bad Request The prevsnapshot query parameter value cannot be newer than snapshot query parameter value. SequenceNumberIncrementTooLarge Conflict The sequence number increment cannot be performed because it would result in overflow of the sequence number. SnapshotCountExceeded Conflict The snapshot count against this blob has been exceeded. SnaphotOperationRateExceeded Conflict The rate of snapshot operations against this blob has been exceeded. SnapshotsPresent Conflict This operation is not permitted while the blob has snapshots. SystemInUse Conflict This blob is in use by the system. UnauthorizedBlobOverwrite Forbidden This request is not authorized to perform blob overwrites. UnsupportedHeader Bad Request One of the headers specified in the request is not supported. BlobBeingRehydrated Conflict This operation is not permitted because the blob is being rehydrated. BlobArchived Conflict This operation is not permitted on an archived blob. BlobNotArchived Conflict This blob is currently not in the archived state. Yes No.

REST API Error Codes 101


The error codes listed in the following table may be returned by an operation on any of the storage services. Skip to main content. Exit focus mode. AccountBeingCreated Conflict The specified account is in the process of being created. AccountIsDisabled Forbidden The specified account is disabled. AuthenticationFailed Forbidden Server failed to authenticate the request. Make sure the value of the Authorization header is formed correctly including the signature. ConditionNotMet Not Modified The condition specified in the conditional header s was not met for a read operation. ConditionNotMet Precondition Failed The condition specified in the conditional header s was not met for a write operation. InsufficientAccountPermissions Forbidden Read operations are currently disabled. InsufficientAccountPermissions Forbidden Write operations are not allowed. InsufficientAccountPermissions Forbidden The account being accessed does not have sufficient permissions to execute this operation. Please retry the request. InvalidAuthenticationInfo Bad Request The authentication information was not provided in the correct format. Verify the value of Authorization header. InvalidInput Bad Request One of the request inputs is not valid. The MD5 value must be bits and Baseencoded. InvalidMetadata Bad Request The specified metadata is invalid. It includes characters that are not permitted. MetadataTooLarge Bad Request The size of the specified metadata exceeds the maximum size permitted. ResourceTypeMismatch Conflict The specified resource type does not match the type of the existing resource. ResourceAlreadyExists Conflict The specified resource already exists. ServerBusy Service Unavailable The server is currently unable to receive requests. Please retry your request. ServerBusy Service Unavailable Ingress is over the account limit. ServerBusy Service Unavailable Egress is over the account limit. ServerBusy Service Unavailable Operations per second is over the account limit. Yes No. Any additional feedback? Skip Submit. Is this page helpful? Server failed to authenticate the request. The authentication information was not provided in the correct format. The MD5 value specified in the request is invalid.

Azure Key Vault REST API Error Codes


By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. The dark mode beta is finally here. Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I'm working on a new API so I can take it any direction right now. I am now adding some error cases, like for instance a client attempts to add a new resource but has exceeded his storage quota. I am already handling certain error cases with HTTP status codes for authentication, for authorization and for plain bad request URIs. I looked over the blessed HTTP error codes but none of the range seems right to report application specific errors. Pay us more and you'll get the storage you need! Besides it feels like I'm splitting the error responses into distinct cases, as some are http status code driven and other are content driven. So what is the industry recommendations? Good practices please explain why! I wouldn't return a unless there really was nothing wrong with the request. From RFCmeans "the request has succeeded. If the client's storage quota has been exceeded for whatever reasonI'd return a Forbidden :. The server understood the request, but is refusing to fulfill it. If the server does not wish to make this information available to the client, the status code Not Found can be used instead. This tells the client that the request was OK, but that it failed something a doesn't do. This also gives you the opportunity to explain the problem and its solution in the response body. Both ways work fine. I agree that, strictly speaking, one of the ideas of REST is that you should use the HTTP Status code as a part of your API return or for a successful operation and a 4xx or 5xx depending on various error cases. However, there are no REST police. You can do what you want. It is now much easier to see the return code when using frameworks than it was in the past. In particular, it is now easier to see the non return case and the body of non responses than it was in the past. You will need to carefully pick 4xx codes that fit your error conditions. You can include a rest, xml, or plaintext message as the payload that includes a sub-code and a descriptive comment. The clients will need to use a software framework that enables them to get at the HTTP-level status code. Usually do-able, not always straight-forward. The clients will have to distinguish between HTTP status codes that indicate a communications error and your own status codes that indicate an application-level issue. The HTTP status code will always be if your app received the request and then responded both success and error cases. ALL of your responses should include "envelope" or "header" information.

HTTP Status Codes

RFC defines the Status-Line syntax as shown below:. The status codes are divided into the five categories presented below. Category Description 1xx: Informational Communicates transfer protocol-level information. It indicates that the REST API successfully carried out whatever action the client requested and that no more specific code in the 2xx series is appropriate. Unlike the status code, a response should include a response body. The information returned with the response is dependent on the method used in the request, for example:. There may also be times when a new resource is created as a result of some controller action, in which case would also be an appropriate response. The newly created resource can be referenced by the URI s returned in the entity of the response, with the most specific URI for the resource given by a Location header field. The origin server MUST create the resource before returning the status code. A response is typically used for actions that take a long while to process. It indicates that the request has been accepted for processing, but the processing has not been completed. The request might or might not be eventually acted upon, or even maybe disallowed when processing occurs. An API may also send in conjunction with a GET request to indicate that the requested resource exists, but has no state representation to include in the body. The user agent e. Otherwise identical, request to the new URL specified in the location field. Many web browsers implemented this code in a manner that violated this standard, changing the request type of the new request to GET, regardless of the type employed in the original request e. RFC and RFC specify that the client is not allowed to change the method on the redirected request. The status codes and have been added for servers that wish to make unambiguously clear which kind of reaction is expected of the client. A response indicates that a controller resource has finished its work, but instead of sending a potentially unwanted response body, it sends the client the URI of a response resource. The response can be the URI of the temporary status message, or the URI to some already existing, more permanent, resource. Generally speaking, the status code allows a REST API to send a reference to a resource without forcing the client to download its state. Instead, the client may send a GET request to the value of the Location header. The critical distinction is that is used when there is nothing to send in the body, whereas is used when the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match. In such a case, there is no need to retransmit the resource since the client still has a previously-downloaded copy. Using this saves bandwidth and reprocessing on both the server and client, as only the header data must be sent and received in comparison to the entirety of the page being re-processed by the server, then sent again using more bandwidth of the server and client. However, future requests should still use the original URI. For example, a response can be used to shift a client request over to another host. If the status code is received in response to a request other than GET or HEADthe user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued. Errors can be like malformed request syntax, invalid request message parameters, or deceptive request routing etc. A error response indicates that the client tried to operate on a protected resource without providing the proper authorization. It may have provided the wrong credentials or none at all. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field. If the request already included Authorization credentials, then the response indicates that authorization has been refused for those credentials. If the response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity might include relevant diagnostic information. Unlike a Unauthorized response, authenticating will make no difference. Subsequent requests by the client are permissible. No indication is given of whether the condition is temporary or permanent.

REST API with Spring Boot - Return Custom HTTP Status Code from RESTful Web Service Endpoint



Comments on “Rest error codes

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>