Index: src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
===================================================================
--- src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php	(revision 40028)
+++ src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php	(working copy)
@@ -726,7 +726,7 @@
 
 			$updated = wp_update_comment( wp_slash( (array) $prepared_args ) );
 
-			if ( false === $updated ) {
+			if ( false === $updated || ! $updated ) {
 				return new WP_Error( 'rest_comment_failed_edit', __( 'Updating comment failed.' ), array( 'status' => 500 ) );
 			}
 
Index: tests/phpunit/tests/rest-api/rest-comments-controller.php
===================================================================
--- tests/phpunit/tests/rest-api/rest-comments-controller.php	(revision 40028)
+++ tests/phpunit/tests/rest-api/rest-comments-controller.php	(working copy)
@@ -2002,7 +2002,7 @@
 		$this->assertEquals( 200, $response->get_status() );
 
 		$response = $this->server->dispatch( $request );
-		$this->assertEquals( 200, $response->get_status() );
+		$this->assertEquals( 500, $response->get_status() );
 	}
 
 	public function test_update_comment_status() {
@@ -2771,6 +2771,47 @@
 		update_comment_meta( $comment->comment_ID, 'my_custom_int', $value );
 	}
 
+	/**
+	 * @ticket
+	 */
+	public function test_update_comment_db_error () {
+		global $wpdb;
+
+		wp_set_current_user( self::$admin_id );
+
+		$params = array(
+			'content' => 'This isn\'t a saxophone. It\'s an umbrella.',
+		);
+
+		// Block comments from being saved, simulate a DB error
+		add_filter( 'query', array( $this, '_block_comments' ) );
+		
+		$request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
+
+		$request->add_header( 'content-type', 'application/json' );
+		$request->set_body( wp_json_encode( $params ) );
+		
+		try {
+			$response = $this->server->dispatch( $request );
+		} catch ( Exception $e )  {
+			$this->assertContains( 'Empty query', $e->getMessage() );
+		}
+
+		remove_filter( 'query', array( $this, '_block_comments' ) );
+	}
+
+	/**
+	 * Block comments from being saved
+	 */
+	public function _block_comments( $sql ) {
+		global $wpdb;
+		if ( false !== strpos( $sql, $wpdb->comments ) && 0 === stripos( trim ( $sql ), 'UPDATE') ) {
+			//echo "\n". $sql . "\n";
+			return '';
+		}
+		return $sql;
+	}
+
 	protected function check_comment_data( $data, $context, $links ) {
 		$comment = get_comment( $data['id'] );
 
