codecombat/codecombat — pull request #195 by smoratinos (2014-01-14 22:29:09+00:00)
Title: refactor server http errors

- error.coffee centralize all http errors response
- unauthorized = 401 and forbiden = 403

**Please review carefully**. I've modified server side and some line are not cover by test.

A change that can be confusing :
Change in server/folder.coffee
`- return errors.unauthorized(res) unless (folder is userfolder) or (req.user.isAdmin())`
`+ return errors.forbidden(res) unless (folder is userfolder) or (req.user.isAdmin())`

api is not break, because in server/errors.coffee, unauthorized (403) became forbidden (403).