We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent beba882 commit ff785d8Copy full SHA for ff785d8
api-builder-plugin-fn-elasticsearch/src/actions/search.js
@@ -78,7 +78,14 @@ async function search(params, options) {
78
addQueryParam("version");
79
80
options.logger.debug(`Using elastic search body: ${JSON.stringify(searchBody)}`);
81
- var queryResult = await client.search( searchBody, { ignore: [404], maxRetries: 3 });
+
82
+ var queryResult;
83
+ try {
84
+ queryResult = await client.search( searchBody, { ignore: [404], maxRetries: 3 });
85
+ } catch (ex) {
86
+ if(ex instanceof Error) throw ex;
87
+ throw new Error(JSON.stringify(ex));
88
+ }
89
90
if(queryResult.status === 404 && queryResult.error.type == "index_not_found_exception") {
91
return options.setOutput('missingIndex', queryResult);
0 commit comments