neo4jrb / neo4j-core

A simple unified API that can access both the server and embedded Neo4j database. Used by the neo4j gem
MIT License
99 stars 80 forks source link

Fail on schema response HTTP error #313

Closed mrstif closed 6 years ago

mrstif commented 6 years ago

When running neo4j:migrate and the call returns an unexpected error, e.g. (502 - Bad Gateway), the following error is returned:

neo4j-core-8.1.2/lib/neo4j/core/cypher_session/adaptors/http.rb:69 constraints NoMethodError: undefined method `map' for #

This is due to the fact that only structured errors are being handled. In order to facilitate debugging, this PR fails on any HTTP error that might occur during that process.

I'm not sure if the :errors key can be present even if the result is a success, so i left the logic separated.

Pings: @cheerfulstoic @subvertallchris

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.01%) to 74.533% when pulling 9e1e95c3ce0031db6d84222cd27a326083a31be4 on mrstif:fail_on_schema_http_error into 431d6099f0adfadf8268a748aa18bb0fdb1adba1 on neo4jrb:master.

cheerfulstoic commented 6 years ago

Seems reasonable, thanks for this!

cheerfulstoic commented 6 years ago

Released as 8.1.3