Skip to content

Added a setter for the REST_Controller's default error message.

Robert Sinton requested to merge feature/api_error_message_setter into master

What I did

  • Added a setter for the REST_Controller's default error message.

Implications

None

Setup

How to test

  • Code review
  • Use it in an API endpoint method, and throw a DF_REST_Exception. Confirm that you see the expected error message.

e.g. in the Art Money redesign project, /api/v1/subscribe.php:

public function index_post()
{
	$this->set_error_message('Sorry, something went wrong with setting up your subscription. Please try again later.');
throw new DF_REST_Exception();	// *** for debugging

Merge request reports