Skip to content

Conversation

@nagibyro
Copy link

@nagibyro nagibyro commented Jul 8, 2021

Fix for #243. When the liquidjs engine throws an error the scope of the catch block has reply.send as undefined. this swallows the liquidjs error. This PR fixes the scoping issue and allows liquid js errors to be sent by fastify correctly.

I'm not sure why https://github.com/fastify/point-of-view/blob/master/test/test-liquid.js#L439 doesn't catch this error. the error my code actually was getting from liquidjs was err.message = 'ENOENT: Failed to lookup "${file}" in "${roots}"'; I added a test to check this error but I couldn't make it fail before I made the change so not sure if it really helps.

Checklist

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@climba03003 climba03003 left a comment

Choose a reason for hiding this comment

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

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot read property 'Symbol(fastify.reply.isRunningOnErrorHook)' of undefined

4 participants