CORE-4173: added new-style error trapping to the /secured/app/:app-id endpoint