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(amplify-appsync-simulator): expose errors from util.validate #6514

Merged
merged 2 commits into from
Feb 10, 2021

Conversation

yuth
Copy link
Contributor

@yuth yuth commented Jan 30, 2021

Updated the simulator to expose util.errors

fix #6068

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@yuth yuth marked this pull request as ready for review February 1, 2021 21:19
@yuth yuth requested a review from a team as a code owner February 1, 2021 21:19
@lgtm-com
Copy link

lgtm-com bot commented Feb 1, 2021

This pull request introduces 4 alerts when merging da22b5b into 5777edd - view on LGTM.com

new alerts:

  • 3 for Unused variable, import, function or class
  • 1 for Disabling certificate validation

@@ -57,6 +57,10 @@ export class VelocityTemplate {
try {
templateResult = this.compiler.render(context);
} catch (e) {
const lastError = context.util.errors.length && context.util.errors[context.util.errors.length - 1];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -44,6 +44,24 @@ export async function deploy(transformerOutput: any, client?: DynamoDB) {
const simulator = await runAppSyncSimulator(config);
return { simulator, config };
}

export async function reDeploy(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: redeploy

@@ -36,10 +37,12 @@ export class TemplateSentError extends Error {
export class Unauthorized extends TemplateSentError {
constructor(gqlMessage, info: GraphQLResolveInfo) {
super(gqlMessage, 'Unauthorized', {}, {}, info);
Object.setPrototypeOf(this, Unauthorized.prototype);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: are we using this prototype information elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without setting this instanceof will not work

Copy link
Contributor

@attilah attilah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, added 2 nits and a question

@yuth yuth merged commit 8273037 into aws-amplify:master Feb 10, 2021
@github-actions
Copy link

This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

$util.validate does not return a message
2 participants