Errors

What happens if there is an error?

If there is an error that is handled gracefully, the response will be JSON with success: false and an error message.

If there is a more serious error, the status may be 500. For example, if the server is unavailable for some unexpected reason. Your code should check the status of the response before checking the JSON.

Example failure response:

    
{
	"success": false,
	"error": "You do not have access to this file."
}