arangodb / arangodb-php

PHP ODM for ArangoDB
https://www.arangodb.com
Apache License 2.0
183 stars 44 forks source link

Fail on Warning #235

Closed iamacup closed 5 years ago

iamacup commented 6 years ago

Hey - is there any way to configure the driver to fail (throw exception) when a warning was generated by ArangoDB? When i print_r the cursor object, i have this in there:

[data:ArangoDBClient\Cursor:private] => Array
        (
            [result] => Array
                (
                )

            [hasMore] => 
            [count] => 0
            [cached] => 
            [extra] => Array
                (
                    [stats] => Array
                        (
                            [writesExecuted] => 0
                            [writesIgnored] => 0
                            [scannedFull] => 0
                            [scannedIndex] => 8
                            [filtered] => 4
                            [httpRequests] => 0
                            [executionTime] => 0.00053644180297852
                        )

                    [warnings] => Array
                        (
                            [0] => Array
                                (
                                    [code] => 1563
                                    [message] => in function 'INTERSECTION()': array expected
                                )

                        )

                )

            [error] => 
            [code] => 201
        )

Current behavior: no exception thrown Desired behavior: exception thrown

Is this a configuration option that i can't see in the docs or is there some other way i can achieve this behavior?

Cheers

jsteemann commented 6 years ago

The PR above contains a method Statement::setFailOnWarning which will allow to do exactly this.

jsteemann commented 5 years ago

Can we close this issue now, as the requested functionality seems to have been implemented a while ago? @iamacup

iamacup commented 5 years ago

Yes, many thanks!

jsteemann commented 5 years ago

Thank you!