Skip to content

Commit

Permalink
Use explicit HTTP 500 on error
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed Jul 9, 2024
1 parent 1f17404 commit e180489
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/API/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function create_item( $request ) {
$hiive_response_notifications = $this->hiive->send_event( $event );

if ( is_wp_error( $hiive_response_notifications ) ) {
return new \WP_REST_Response( $hiive_response_notifications->get_error_message(), $hiive_response_notifications->get_error_code() );
return new \WP_REST_Response( $hiive_response_notifications->get_error_message(), 500 );
}

return new \WP_REST_Response( array( 'data' => $hiive_response_notifications ), 201 );
Expand Down

0 comments on commit e180489

Please sign in to comment.