Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaid-Ajaj committed Oct 26, 2022
1 parent f924400 commit 05139ed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sdk/nodejs/automation/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ export class StackAlreadyExistsError extends CommandError {
const notFoundRegex = new RegExp("no stack named.*found");
const alreadyExistsRegex = new RegExp("stack.*already exists");
const conflictText = "[409] Conflict: Another update is currently in progress.";
const localBackendConflictText = "the stack is currently locked by"
const localBackendConflictText = "the stack is currently locked by";

/** @internal */
export function createCommandError(result: CommandResult): CommandError {
const stderr = result.stderr;
return (
notFoundRegex.test(stderr) ? new StackNotFoundError(result)
: alreadyExistsRegex.test(stderr) ? new StackAlreadyExistsError(result)
: stderr.indexOf(conflictText) >= 0 ? new ConcurrentUpdateError(result)
: stderr.indexOf(localBackendConflictText) >= 0 ? new ConcurrentUpdateError(result)
: new CommandError(result)
: alreadyExistsRegex.test(stderr) ? new StackAlreadyExistsError(result)
: stderr.indexOf(conflictText) >= 0 ? new ConcurrentUpdateError(result)
: stderr.indexOf(localBackendConflictText) >= 0 ? new ConcurrentUpdateError(result)
: new CommandError(result)
);
}

0 comments on commit 05139ed

Please sign in to comment.