@@ -69,7 +69,7 @@ describe('examples', function() {
69
69
session . close ( ) ;
70
70
driver . close ( ) ;
71
71
} ) ;
72
- // tag ::minimal-example[]
72
+ // end ::minimal-example[]
73
73
setTimeout ( function ( ) {
74
74
expect ( out [ 0 ] ) . toBe ( "Neo is 23 years old." ) ;
75
75
done ( ) ;
@@ -153,7 +153,7 @@ describe('examples', function() {
153
153
console . log ( error ) ;
154
154
}
155
155
} ) ;
156
- // end::result-cursor []
156
+ // end::retain- result-query []
157
157
// Then
158
158
done ( ) ;
159
159
} ) ;
@@ -210,18 +210,30 @@ describe('examples', function() {
210
210
} , 500 ) ;
211
211
} ) ;
212
212
213
+ it ( 'should be able to handle cypher error' , function ( done ) {
214
+ var session = sessionGlobal ;
215
+
216
+ // tag::handle-cypher-error[]
217
+ session
218
+ . run ( "Then will cause a syntax error" )
219
+ . catch ( function ( err ) {
220
+ expect ( err . fields [ 0 ] . code ) . toBe ( "Neo.ClientError.Statement.SyntaxError" ) ;
221
+ done ( ) ;
222
+ } ) ;
223
+ // end::handle-cypher-error[]
224
+ } ) ;
213
225
214
226
it ( 'should be able to profile' , function ( done ) {
215
227
var session = sessionGlobal ;
216
228
217
229
session . run ( "CREATE (:Person {name:'The One', age: 23})" ) . then ( function ( ) {
218
- // tag::retain- result-process []
230
+ // tag::result-summary-query-profile []
219
231
session
220
232
. run ( "PROFILE MATCH (p:Person { name: {name} }) RETURN id(p)" , { name : "The One" } )
221
233
. then ( function ( result ) {
222
234
console . log ( result . summary . profile ) ;
223
235
} ) ;
224
- // end::retain- result-process []
236
+ // end::result-summary-query-profile []
225
237
} ) ;
226
238
227
239
//await the result
@@ -234,7 +246,7 @@ describe('examples', function() {
234
246
it ( 'should be able to see notifications' , function ( done ) {
235
247
var session = sessionGlobal ;
236
248
237
- // tag::retain- result-process []
249
+ // tag::result-summary-notifications []
238
250
session
239
251
. run ( "EXPLAIN MATCH (a), (b) RETURN a,b" )
240
252
. then ( function ( result ) {
@@ -243,7 +255,7 @@ describe('examples', function() {
243
255
console . log ( notifications [ i ] . code ) ;
244
256
}
245
257
} ) ;
246
- // end::retain- result-process []
258
+ // end::result-summary-notifications []
247
259
248
260
setTimeout ( function ( ) {
249
261
expect ( out [ 0 ] ) . toBe ( "Neo.ClientNotification.Statement.CartesianProductWarning" ) ;
0 commit comments