Message d'erreur personnalisé objet json avec flacon-sommeil

Il est facile de propager des messages d'erreur avec flacon reposant pour le client avec la abort() méthode, telle que

abort(500, message="Fatal error: Pizza the Hutt was found dead earlier today
in the back seat of his stretched limo. Evidently, the notorious gangster
became locked in his car and ate himself to death.")

Cela va générer à la suite de la sortie json

{
  "message": "Fatal error: Pizza the Hutt was found dead earlier today
       in the back seat of his stretched limo. Evidently, the notorious gangster
       became locked in his car and ate himself to death.", 
  "status": 500
}

Est-il un moyen de personnaliser la sortie json avec d'autres membres? Par exemple:

{
  "sub_code": 42,
  "action": "redirect:#/Outer/Space"
  "message": "You idiots! These are not them! You've captured their stunt doubles!", 
  "status": 500
}
InformationsquelleAutor Derek | 2014-02-07