Error types and corresponding messages

 

 

Status
IN PROGRESS
Stakeholders
Outcome
Due date
Owner

Background

Listing most likely error cases, associated HTTP status codes and respective messages for slidewiki end users:

 

 Possible casesHTTP error code (HTTP header)

(Draft) Message for SlideWiki end users

Comments
1
  1. URL parameter type validation fails, e.g., alphanumeric deck id instead of positive number.
  2. URL route error, e.g., http://slidewiki.com/myslides . This URL path pattern does not exist.
  3. Parameter missing
400
  1. Bad Request
    Deck id must be a positive integer. Please check the URL of your request.
  2. Bad Request
    URL path incorrect. Please check the URL of your request.
  3. Bad Request
    One or more parameters were missing.
 
2
  1. Accessing a resource without appropriate login credentials
403
  1. Forbidden
    Sorry, access denied. Please provide appropriate login credentials.
 
3
  1. Accessing a deck/slide/question which does not exist
404
  1. Not Found
    The content your are looking for does not exist.
 
4
  1. Accessing a page using another HTTP method. E.g., Instead of sending expected GET request, user is sending POST/PUT/DELETE request.
405
  1. Method Not Found
    The request method POST is inappropriate for this request.

This is not implemented yet for two reasons:

1. It doesn't fit as part of URL parameters and

2. If we don't want to strictly following HTTP method when calling a web page. It matters a lot in case of REST API but not so in case of delivering a page on browser.

We can implement it if needed. 

5
  1. User is sending a payload that is too large. E.g., user is trying to upload a file that is too big or user is submitting a form, e.g., deliberately via request modification, that contains large amount of data not expected by the server. This is only for POST and PUT requests.
413
  1. Payload Too Large
    The server is refusing to process this request because the request payload is larger than the server is willing to process.
This is not implemented as of now though it is fairly simple in terms of implementation. We need to decide what we call a large PayLoad as that would decide the checking criteria.
6
  1. URI too long. E.g., user has typed a URL that is a very long GET request. This can happen when user is sending a GET request instead of expected POST request (assuming that GET method is also allowed on that resource)
414
  1. URI Too Long
    The server is refusing to service the request because the URL is longer than the server is willing to interpret.
This is not implemented as of now though it is fairly simple in terms of implementation. We need to decide what we call a Too Long URI as that would decide the checking criteria.
7
  1. When a HTTP request is correct syntactically but is not correct semantically in a way that server should not process that request then the server should throw 422 status code - Unprocessable entity.

    Examples:

    1. Search request sent without a search query, i.e., empty string sent for search
    2. User has sent a password that follows syntactical rules but is too simple to guess, like sending 'Password' as password.
422
  1. Unprocessable Entity
 
8
  1. When server encounters unexpected condition. E.g., due to file permission or configuration errors
500
  1. Internal Server Error
    The server encountered an unexpected condition that prevented it from fulfilling the request.
 
9
  1. When the server is acting as gateway or proxy and receives incorrect response from inbound servers. E.g., incomplete header or response body caused due to connection error.
502
  1. Bad Gateway
    The server encountered a temporary error and could not complete your request. Please try again after some time.
Vinay: a customized error page for Nginx would also make sense if the error is due to upstream slidewiki server.
10
  1. When the service is unavailable. E.g., server overload or down for maintenance.
503
  1. Service Unavailable
    Sorry, the site is temporarily down. We apologize for inconvenience. Please try again after some time or contact administrator.
Vinay: a customized error page for Nginx would also make sense if the error is due to upstream slidewiki server.
11
  1. When the server which is acting as gateway is not receiving response from upstream servers. E.g., Upstream server is taking long time to process the request and timeout occurs. Reason could be timeout duration too short, poor data speed, upstream busy in CPU/IO intensive task etc.
504
  1. Gateway Timeout
    The server did not receive a timely response from upstream server. Please try again after some time.
Vinay: a customized error page for Nginx would also make sense if the error is due to upstream slidewiki server.

 

 

Action items

  •