Skip to content

Commit c7c3551

Browse files
committed
Make NoSuchRecordException subclass NoSuchElementException to comply with Java iteration
1 parent 34deab0 commit c7c3551

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

driver/src/main/java/org/neo4j/driver/v1/exceptions/Neo4jException.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
package org.neo4j.driver.v1.exceptions;
2020

2121
/**
22-
* This is the base class for all Neo4j exceptions.
22+
* This is the base class for all exceptions caused as part of communication with the remote Neo4j server.
23+
*
2324
* @since 1.0
2425
*/
2526
public abstract class Neo4jException extends RuntimeException

driver/src/main/java/org/neo4j/driver/v1/exceptions/NoSuchRecordException.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,16 @@
1818
*/
1919
package org.neo4j.driver.v1.exceptions;
2020

21+
import java.util.NoSuchElementException;
22+
2123
/**
24+
* Thrown whenever a client expected to read a record that was not available (i.e. because it wasn't returned by the server).
25+
*
26+
* This usually indicates an expectation mismatch between client code and database application logic.
27+
*
2228
* @since 1.0
2329
*/
24-
public class NoSuchRecordException extends ClientException
30+
public class NoSuchRecordException extends NoSuchElementException
2531
{
2632
private static final long serialVersionUID = 9091962868264042491L;
2733

0 commit comments

Comments
 (0)