puppetlabs/puppet — pull request #2263 by aperiodic (2014-01-15 01:35:34+00:00)
Title: (PUP-1432) Add V2 API structured errors.

This commit introduces error responses, a JSON object as described
in the api documentation (with associated schema).

It introduces the Puppet::Network::HTTP::Issues module, which collects
the known issue_kind values, in order to ensure consistency and provide
ability to yardoc them.

It adds two HTTPError subclasses for future use: an HTTPBadRequestError
(400 response), and an HTTPServerError class. The HTTPServerError
allows the API to provide more information about an unexpected error
than simply letting the error bubble up to be caught by the generic
HTTP handler.