RAWS Error Response

From Rambla Wiki
Jump to: navigation, search

Overview

If a RAWS request results in an error, the HTTP reply contains:

  • An appropriate 4xx, or 5xx HTTP status code
  • A 'Content-Type Header' set to application/xml
  • An XML error document as the response body (except for HEAD requests)

The Response Body

The Response Body of a RAWS error has the following general structure:

<?xml version="1.0"?>
<error xmlns="http://rambla.be/raws/ns-metadata/1.0">
    <code>ResourceNotAccessible</code>
    <message>You are not allowed to access this resource.</message>
    <reason>User 'monty' doesn't have access to the home directory of the requested path (= /no_access).</reason>
</error>

All error responses have the following common elements in their body:

  • code : The RAWS error code. This is a string that uniquely identifies an error condition returned by the RAmbla Web Services. It is meant to be read and understood by programs that detect and handle errors by type.
  • message : Contains the human readable explanation of the RAWS error-code.
  • reason : A string containing further information about the occurrence of the error.
  • details : This is an optional element that may contain some additional, error-specific details.

List of Error Codes

RASS error code RASS error message HTTP status code
InvalidURI The path specified in the URI is not supported by this service. 400 BAD REQUEST
IncompleteHeader The HTTP Header didn't include a required part. 400 BAD REQUEST
IncompleteBody You did not provide the number of bytes specified by the Content-Length HTTP header. 400 BAD REQUEST
InvalidInputData Invalid or incomplete input data was provided. 400 BAD REQUEST
InvalidCredentials None or invalid credentials were supplied for authorization to this realm. 401 UNAUTHORIZED
ResourceNotAccessible You are not allowed to access this resource. 403 FORBIDDEN
ResourceCanNotBeEdited You are not allowed to edit this resource. 403 FORBIDDEN
ResourceCanNotBeDeleted You are not allowed to delete this resource. 403 FORBIDDEN
InvalidDirAccess You are not authorized to access this directory. 403 FORBIDDEN
InvalidItemAccess You are not authorized to access this item. 403 FORBIDDEN
InvalidUserAccess You are not authorized to manage users. 403 FORBIDDEN
NoSuchUser The specified user does not exist. 404 NOT FOUND
NoSuchResource The specified resource does not exist. 404 NOT FOUND
NoSuchDir The specified directory does not exist. 404 NOT FOUND
NoSuchItem The specified item does not exist. 404 NOT FOUND
MethodNotAllowed The specified method is not allowed against this resource. 405 METHOD NOT ALLOWED
ResponsetTypeNotAcceptable The response type is not supported for this resource and method. 406 NOT ACCEPTABLE
ResourceAlreadyExists A resource already exists at the given URI. 409 CONFLICT
DirAlreadyExists The directory you tried to create already exists. 409 CONFLICT
DirNotEmpty The directory you tried to delete is not empty. 409 CONFLICT
ItemAlreadyExists The item you tried to create already exists. 409 CONFLICT
UserAlreadyExists The user you tried to create already exists. 409 CONFLICT
MissingContentLength You must provide the Content-Length HTTP header. 411 LENGTH REQUIRED
InternalError We encountered an internal error. Please try again. 500 INTERNAL SERVER ERROR
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox