cayleygraph / cayley

An open-source graph database
https://cayley.io
Apache License 2.0
14.85k stars 1.25k forks source link

refactor: return errors from ValueOf, NameOf, QuadDirection #959

Closed paralin closed 3 years ago

paralin commented 3 years ago

Adds error return values to ValueOf(), NameOf(), QuadDirection on the QuadStore. The QuadStore currently returns a value for these functions without an error, but internally the QuadStore might run into some errors when processing the value. This hack is clearly identified in the code: rather than return the error, it's just logged.

If the QuadStore has an error while processing ValueOf or NameOf, the returned value will be nil which might lead to many types of undefined behavior - such as queries returning "nil" for one field of a Quad.

Fixes #985


This change is Reviewable

paralin commented 3 years ago

@dennwc thanks for review, changes applied.

paralin commented 3 years ago

I haven't had a chance to check the docs thoroughly, might want to make an issue to re-check that later.