We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f02265e + 118a145 commit 7ac7247Copy full SHA for 7ac7247
src/index.ts
@@ -89,7 +89,11 @@ export async function start(options: StartESOptions): Promise<void> {
89
const error = getESError(result);
90
91
if (error) {
92
- throw new Error(`Failed to create index: ${error.reason}`);
+ if (error.type === 'resource_already_exists_exception') {
93
+ debug(`Index ${name} already exists.`);
94
+ } else {
95
+ throw new Error(`Failed to create index: ${error.reason}`);
96
+ }
97
}
98
})
99
);
@@ -139,6 +143,7 @@ async function isExistingFile(filepath: string): Promise<boolean> {
139
143
140
144
interface ESError {
141
145
reason: string;
146
+ type: string;
142
147
148
149
function getESError(esResponse: Buffer): ESError | undefined {
0 commit comments