Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve trigger update error handling #8329

Merged
merged 1 commit into from
Oct 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import chalk from 'chalk';
import * as fs from 'fs-extra';
import * as path from 'path';
import _ from 'lodash';
import { JSONUtilities, $TSAny } from 'amplify-cli-core';
import { exitOnNextTick, JSONUtilities, $TSAny } from 'amplify-cli-core';
import Separator from 'inquirer/lib/objects/separator';

// keep in sync with ServiceName in amplify-category-function, but probably it will not change
Expand Down Expand Up @@ -193,10 +193,12 @@ export const updateTrigger = async triggerOptions => {

await cleanFunctions(key, values, category, context, targetPath);
}
context.print.success('Successfully updated the Lambda function locally');
context.print.success('Successfully updated the Cognito trigger locally');
return null;
} catch (e) {
throw new Error('Unable to update lambda function');
} catch (err: $TSAny) {
context.print.error(`Error updating the Cognito trigger: ${err.message}`);
await context.usageData.emitError(err);
exitOnNextTick(1);
}
};

Expand Down