Skip to content

Catch errors thrown by type parsers and emit error - #954

Closed
aheuermann wants to merge 1 commit into
brianc:masterfrom
aheuermann:parse_row_error
Closed

Catch errors thrown by type parsers and emit error#954
aheuermann wants to merge 1 commit into
brianc:masterfrom
aheuermann:parse_row_error

Conversation

@aheuermann

Copy link
Copy Markdown
Contributor

Errors thrown by type parsers are not currently caught. This catches them and emits an error.

@aheuermann

Copy link
Copy Markdown
ContributorAuthor

Looks like I need to update pg-native too.

@brianc

Copy link
Copy Markdown
Owner

I appreciate the work here, but I think the best place for this logic would likely be inside the type parsers themselves and not here - most type parsers don't throw under any circumstance...if you need special try/catch in a type parser best approach is probably to override the type parser like you've done here in your tests & try/catch there.

@briancbrianc closed this Jun 20, 2016
@felixfbecker

felixfbecker commented Aug 26, 2016

Copy link
Copy Markdown

Please note though that query() is an asynchronous function, and async functions should either always throw synchronously or always throw asynchronously (emit an error event, callback with error, reject). Everything else leads to very hard to find bugs (commonly referred to as "releasing Zalgo")

Sign up for freeto 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.

3 participants

@aheuermann@brianc@felixfbecker