Skip to content

Unpack failure messages to Neo4jErrors #204

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 2 commits into from
Feb 17, 2017

Conversation

lutovich
Copy link
Contributor

@lutovich lutovich commented Feb 16, 2017

Previously raw FAILURE message was passed to onError-like callbacks and thrown as is. This means thrown error contained packstream related fields and actually was a packstream structure. Example:

Structure {
  signature: 127,
  fields: [
    {
      code: 'Neo.ClientError.Schema.ConstraintValidationFailed',
      message: 'Node 0 already exists with label A and property "a"=[42]'
    }
  ]
}

This commit makes sure we unpack/convert FAILURE messages to Neo4jErrors and pass those further to callbacks.

Fixes #201

Previously raw FAILURE message was passed to `onError`-like callbacks and
thrown as is. This means thrown error contained packstream related fields and
actually was a packstream structure. Example:

```
Structure {
  signature: 127,
  fields: [
    {
      code: 'Neo.ClientError.Schema.ConstraintValidationFailed',
      message: 'Node 0 already exists with label A and property "a"=[42]'
    }
  ]
}
```

This commit makes sure we unpack/convert FAILURE messages to `Neo4jError`s
and pass those further to callbacks.
@lutovich lutovich force-pushed the 1.1-single-err-format branch from 1330243 to 517e47d Compare February 16, 2017 10:47
@oskarhane
Copy link
Member

Thanks for this!
lgtm

@lutovich lutovich merged commit d3edd44 into neo4j:1.1 Feb 17, 2017
@lutovich lutovich deleted the 1.1-single-err-format branch February 17, 2017 13:24
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