@@ -155,35 +155,35 @@ protected function bulkSend(array $records): void
155
155
throw new RuntimeException ('Error sending messages to Elasticsearch ' , 0 , $ e );
156
156
}
157
157
}
158
- }
159
-
160
- /**
161
- * Creates elasticsearch exception from responses array
162
- *
163
- * Only the first error is converted into an exception.
164
- *
165
- * @param array $responses returned by $this->client->bulk()
166
- */
167
- protected function createExceptionFromResponses (array $ responses ): ElasticsearchRuntimeException
168
- {
169
- foreach ($ responses ['items ' ] ?? [] as $ item ) {
170
- if (isset ($ item ['index ' ]['error ' ])) {
171
- return $ this ->createExceptionFromError ($ item ['index ' ]['error ' ]);
172
- }
173
- }
174
-
175
- return new ElasticsearchRuntimeException ('Elasticsearch failed to index one or more records. ' );
176
- }
177
-
178
- /**
179
- * Creates elasticsearch exception from error array
180
- *
181
- * @param array $error
182
- */
183
- protected function createExceptionFromError (array $ error ): ElasticsearchRuntimeException
184
- {
185
- $ previous = isset ($ error ['caused_by ' ]) ? $ this ->createExceptionFromError ($ error ['caused_by ' ]) : null ;
186
-
187
- return new ElasticsearchRuntimeException ($ error ['type ' ] . ': ' . $ error ['reason ' ], 0 , $ previous );
188
- }
158
+ }
159
+
160
+ /**
161
+ * Creates elasticsearch exception from responses array
162
+ *
163
+ * Only the first error is converted into an exception.
164
+ *
165
+ * @param array $responses returned by $this->client->bulk()
166
+ */
167
+ protected function createExceptionFromResponses (array $ responses ): ElasticsearchRuntimeException
168
+ {
169
+ foreach ($ responses ['items ' ] ?? [] as $ item ) {
170
+ if (isset ($ item ['index ' ]['error ' ])) {
171
+ return $ this ->createExceptionFromError ($ item ['index ' ]['error ' ]);
172
+ }
173
+ }
174
+
175
+ return new ElasticsearchRuntimeException ('Elasticsearch failed to index one or more records. ' );
176
+ }
177
+
178
+ /**
179
+ * Creates elasticsearch exception from error array
180
+ *
181
+ * @param array $error
182
+ */
183
+ protected function createExceptionFromError (array $ error ): ElasticsearchRuntimeException
184
+ {
185
+ $ previous = isset ($ error ['caused_by ' ]) ? $ this ->createExceptionFromError ($ error ['caused_by ' ]) : null ;
186
+
187
+ return new ElasticsearchRuntimeException ($ error ['type ' ] . ': ' . $ error ['reason ' ], 0 , $ previous );
188
+ }
189
189
}
0 commit comments