File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 14
14
namespace Laudis \Neo4j \Bolt ;
15
15
16
16
use Bolt \Bolt ;
17
+ use Bolt \error \MessageException ;
17
18
use Ds \Vector ;
18
19
use Exception ;
19
20
use Laudis \Neo4j \Contracts \FormatterInterface ;
@@ -81,16 +82,25 @@ public function rollback(): void
81
82
}
82
83
}
83
84
85
+ /**
86
+ * @throws Throwable
87
+ */
84
88
public function run (string $ statement , iterable $ parameters = [])
85
89
{
86
90
return $ this ->runStatement (new Statement ($ statement , $ parameters ));
87
91
}
88
92
93
+ /**
94
+ * @throws Throwable
95
+ */
89
96
public function runStatement (Statement $ statement )
90
97
{
91
98
return $ this ->runStatements ([$ statement ])->first ();
92
99
}
93
100
101
+ /**
102
+ * @throws Throwable
103
+ */
94
104
public function runStatements (iterable $ statements ): CypherList
95
105
{
96
106
/** @var Vector<T> $tbr */
@@ -104,7 +114,10 @@ public function runStatements(iterable $statements): CypherList
104
114
/** @var array<array> $results */
105
115
$ results = $ this ->bolt ->pullAll ();
106
116
} catch (Throwable $ e ) {
107
- throw new Neo4jException (new Vector ([new Neo4jError ('' , $ e ->getMessage ())]), $ e );
117
+ if ($ e instanceof MessageException) {
118
+ throw new Neo4jException (new Vector ([new Neo4jError ('' , $ e ->getMessage ())]), $ e );
119
+ }
120
+ throw $ e ;
108
121
}
109
122
$ tbr ->push ($ this ->formatter ->formatBoltResult ($ meta , $ results , $ this ->bolt ));
110
123
}
You can’t perform that action at this time.
0 commit comments