I'm developing some kind of RESTful API. When some error occurs, I throw an
App::abort($code, $message) error.
The problem is: I want him to throw a json formed array with keys "code" and "message", each one containing the above mentioned data.
Array ( [code] => 401 [message] => "Invalid User" )
Does any one knows if it's possible, and if it is, how I do it?