fixes bug 969062 - Return more descriptive 4xx errors in JSON, r=AdrianGaudebert