MantisBT: master c0747fc8

Author Committer Branch Timestamp Parent
vboctor vboctor master 2017-12-08 19:41 master 61059a31
Affected Issues  0023714: Failing REST API requests should include Mantis error code and localized message
Changeset

Improve REST API error handling

  • Specific route handlers don’t need to catch exceptions just to return them in the response.
  • In case of errors include a json with Mantis error code, message, and localized message for thrown exceptions.
  • Convert RestFault and throw, though in this case only include the message in json, no code or localized message.

LegacyApiFaultException can be removed once all APIs throw proper exceptions instead of returning RestFault.

Fixes 0023714

mod - api/rest/index.php Diff File
mod - api/rest/restcore/issues_rest.php Diff File
mod - api/soap/mantisconnect.php Diff File
mod - api/soap/mc_api.php Diff File
mod - api/soap/mc_core.php Diff File
mod - core/error_api.php Diff File
add - core/exceptions/LegacyApiFaultException.php Diff File