|
@@ -209,7 +209,11 @@ class ElasticsearchHandler extends AbstractProcessingHandler
|
|
|
return new ElasticInvalidArgumentException('Elasticsearch failed to index one or more records.');
|
|
return new ElasticInvalidArgumentException('Elasticsearch failed to index one or more records.');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return new ElasticsearchRuntimeException('Elasticsearch failed to index one or more records.');
|
|
|
|
|
|
|
+ if (class_exists(ElasticsearchRuntimeException::class)) {
|
|
|
|
|
+ return new ElasticsearchRuntimeException('Elasticsearch failed to index one or more records.');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ throw new \LogicException('Unsupported elastic search client version');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -225,6 +229,10 @@ class ElasticsearchHandler extends AbstractProcessingHandler
|
|
|
return new ElasticInvalidArgumentException($error['type'] . ': ' . $error['reason'], 0, $previous);
|
|
return new ElasticInvalidArgumentException($error['type'] . ': ' . $error['reason'], 0, $previous);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return new ElasticsearchRuntimeException($error['type'] . ': ' . $error['reason'], 0, $previous);
|
|
|
|
|
|
|
+ if (class_exists(ElasticsearchRuntimeException::class)) {
|
|
|
|
|
+ return new ElasticsearchRuntimeException($error['type'].': '.$error['reason'], 0, $previous);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ throw new \LogicException('Unsupported elastic search client version');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|