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

Added missing argument to handleError method call. #552

Merged
merged 1 commit into from Apr 3, 2014
Merged

Added missing argument to handleError method call. #552

merged 1 commit into from Apr 3, 2014

Conversation

geon
Copy link
Contributor

@geon geon commented Mar 29, 2014

Before the change, it would crash with a very unhelpful error message:

[project path]/node_modules/pg/lib/query.js:92
    connection.sync();
               ^
TypeError: Cannot call method 'sync' of undefined
    at Query.handleError ([project path]/node_modules/pg/lib/query.js:92:16)
    at Client.connect ([project path]/node_modules/pg/lib/client.js:178:24)
    at g (events.js:185:14)
    at EventEmitter.emit (events.js:85:17)
    at Socket.<anonymous> ([project path]/node_modules/pg/lib/connection.js:60:10)
    at Socket.EventEmitter.emit (events.js:85:17)
    at TCP.onread (net.js:424:51)

After the change, it reports a much more helpful

error running query [Error: Stream unexpectedly ended during query execution]

Before the change, it would crash with a very unhelpful error message:

	[project path]/node_modules/pg/lib/query.js:92
	    connection.sync();
	               ^
	TypeError: Cannot call method 'sync' of undefined
	    at Query.handleError ([project path]/node_modules/pg/lib/query.js:92:16)
	    at Client.connect ([project path]/node_modules/pg/lib/client.js:178:24)
	    at g (events.js:185:14)
	    at EventEmitter.emit (events.js:85:17)
	    at Socket.<anonymous> ([project path]/node_modules/pg/lib/connection.js:60:10)
	    at Socket.EventEmitter.emit (events.js:85:17)
	    at TCP.onread (net.js:424:51)


After the change, it reports a much more helpful

	error running query [Error: Stream unexpectedly ended during query execution]
@brianc
Copy link
Owner

brianc commented Apr 3, 2014

👍

brianc added a commit that referenced this pull request Apr 3, 2014
Added missing argument to handleError method call.
@brianc brianc merged commit 7dbc4c9 into brianc:master Apr 3, 2014
@brianc
Copy link
Owner

brianc commented Apr 3, 2014

Thanks for this - very helpful! Pretty sure the way I had it before your fix was just a downright bug.

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.

None yet

2 participants