Skip to content

Commit a71b8aa

Browse files
committed
Update bulk exception response guidance
1 parent ee29215 commit a71b8aa

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/Exceptions/BulkRequestException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ protected static function makeMessageFromResponse(array $response): string
7171
$reason .= sprintf(' %s: %s. Reason: %s.', $count > 1 ? 'First error' : 'Error', $firstError['type'], $firstError['reason']);
7272
}
7373

74-
return sprintf('%s Catch the exception and use the %s::getResponse() method to get more details.', $reason, self::class);
74+
return sprintf('%s Catch the exception and use the %s::response() method to get more details.', $reason, self::class);
7575
}
7676
}

tests/Unit/Exceptions/BulkRequestExceptionTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
$exception = BulkRequestException::fromResponse($response);
5959

6060
$this->assertEquals(
61-
'1 bulk operation(s) did not complete successfully. Error: document_missing_exception. Reason: [_doc][5]: document missing. Catch the exception and use the DirectoryTree\OpenSearchAdapter\Exceptions\BulkRequestException::getResponse() method to get more details.',
61+
'1 bulk operation(s) did not complete successfully. Error: document_missing_exception. Reason: [_doc][5]: document missing. Catch the exception and use the DirectoryTree\OpenSearchAdapter\Exceptions\BulkRequestException::response() method to get more details.',
6262
$exception->getMessage()
6363
);
6464
});
@@ -104,7 +104,7 @@
104104
$exception = BulkRequestException::fromResponse($response);
105105

106106
$this->assertEquals(
107-
'2 bulk operation(s) did not complete successfully. First error: document_missing_exception. Reason: [_doc][5]: document missing. Catch the exception and use the DirectoryTree\OpenSearchAdapter\Exceptions\BulkRequestException::getResponse() method to get more details.',
107+
'2 bulk operation(s) did not complete successfully. First error: document_missing_exception. Reason: [_doc][5]: document missing. Catch the exception and use the DirectoryTree\OpenSearchAdapter\Exceptions\BulkRequestException::response() method to get more details.',
108108
$exception->getMessage()
109109
);
110110
});
@@ -128,7 +128,7 @@
128128
$exception = BulkRequestException::fromResponse($response);
129129

130130
$this->assertEquals(
131-
'1 bulk operation(s) did not complete successfully. Catch the exception and use the DirectoryTree\OpenSearchAdapter\Exceptions\BulkRequestException::getResponse() method to get more details.',
131+
'1 bulk operation(s) did not complete successfully. Catch the exception and use the DirectoryTree\OpenSearchAdapter\Exceptions\BulkRequestException::response() method to get more details.',
132132
$exception->getMessage()
133133
);
134134
});
@@ -143,7 +143,7 @@
143143
$exception = BulkRequestException::fromResponse($response);
144144

145145
$this->assertEquals(
146-
'One or more did not complete successfully. Catch the exception and use the DirectoryTree\OpenSearchAdapter\Exceptions\BulkRequestException::getResponse() method to get more details.',
146+
'One or more did not complete successfully. Catch the exception and use the DirectoryTree\OpenSearchAdapter\Exceptions\BulkRequestException::response() method to get more details.',
147147
$exception->getMessage()
148148
);
149149
});

0 commit comments

Comments
 (0)