8000 fix(debug): be more careful when monkey-patching by benjie · Pull Request #987 · graphile/crystal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(debug): be more careful when monkey-patching #987

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

Merged
merged 1 commit into from
Feb 5, 2019

Conversation

benjie
Copy link
Member
@benjie benjie commented Feb 5, 2019

Previously a call to pgPool.query (in the user's code) would throw an error when some DEBUG variables were set:

/usr/src/app/node_modules/postgraphile/build/postgraphile/withPostGraphileContext.js:250
                promiseResult.catch((error) => {
                              ^

TypeError: Cannot read property 'catch' of undefined
    at Client.pgClient.query (/usr/src/app/node_modules/postgraphile/build/postgraphile/withPostGraphileContext.js:250:31)
    at PendingItem.connect [as callback] (/usr/src/app/node_modules/pg-pool/index.js:294:14)
    at Pool._pulseQueue (/usr/src/app/node_modules/pg-pool/index.js:142:21)
    at process.nextTick (/usr/src/app/node_modules/pg-pool/index.js:178:37)
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
    at process._tickDomainCallback (internal/process/next_tick.js:219:9)
error Command failed with exit code 1.

This PR means we're more careful with what we can handle, everything else gets passed through without debugging.

Copy link
@sjmcdowall sjmcdowall left a comment

Choose a reason for hiding this comment

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

Looks safe .. if it passes the tests :)

@benjie benjie merged commit c47f4be into master Feb 5, 2019
@benjie benjie deleted the fix-debug-pool-monkeypatch branch February 5, 2019 18:23
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.

2 participants
0