-
Notifications
You must be signed in to change notification settings - Fork 822
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
Conversation
Updated the simulator to expose util.errors fix aws-amplify#6068
This pull request introduces 4 alerts when merging da22b5b into 5777edd - view on LGTM.com new alerts:
|
@@ -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]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could use: https://lodash.com/docs/4.17.15#last
@@ -44,6 +44,24 @@ export async function deploy(transformerOutput: any, client?: DynamoDB) { | |||
const simulator = await runAppSyncSimulator(config); | |||
return { simulator, config }; | |||
} | |||
|
|||
export async function reDeploy( |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this 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
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 |
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.