Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jrodewig committed Nov 6, 2024
1 parent 700a624 commit 1fc6db2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
20 changes: 12 additions & 8 deletions src/main/java/com/fauna/response/ConstraintFailure.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ public final class ConstraintFailure {
private final PathElement[][] paths;

/**
* Initialize a new ConstraintFailure instance.
* Initialize a new ConstraintFailure instance. Queries that fail a <a
* href="https://docs.fauna.com/fauna/current/reference/fsl/check/">check</a>
* or <a
* href="https://docs.fauna.com/fauna/current/reference/fsl/unique/">unique
* constraint> return a constraint failure.
*
* @param message The constraint failure message.
* @param name The constraint failure name.
* @param paths The constraint failure paths.
* @param message Human-readable description of the constraint failure.
* @param name Name of the failed constraint.
* @param paths A list of paths where the constraint failure occurred.
*/
public ConstraintFailure(
final String message,
Expand Down Expand Up @@ -135,7 +139,7 @@ public Optional<String> getName() {
}

/**
* Gets an optional of path elements related to the constraint failure.
* Gets an optional path elements related to the constraint failure.
*
* @return An array of arrays of PathElements.
*/
Expand Down Expand Up @@ -235,7 +239,7 @@ public static PathElement parse(final JsonParser parser)
/**
* Tests whether the PathElement stores a string or an integer.
*
* @return True if it's a string, else false.
* @return If it's a string, true. Otherwise, false.
*/
public boolean isString() {
return sVal != null;
Expand Down Expand Up @@ -276,7 +280,7 @@ public static class Builder {
* Sets a message on the builder.
*
* @param message The message to set.
* @return this
* @return this.
*/
public Builder message(final String message) {
this.message = message;
Expand All @@ -287,7 +291,7 @@ public Builder message(final String message) {
* Sets a name on the builder.
*
* @param name The name to set.
* @return this
* @return this.
*/
public Builder name(final String name) {
this.name = name;
Expand Down
17 changes: 12 additions & 5 deletions src/main/java/com/fauna/response/ErrorInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,17 @@ public class ErrorInfo {
/**
* Initializes a new ErrorInfo.
*
* @param code The Fauna error code
* @param message The error message
* @param constraintFailures The constraint failures, if any
* @param abort A abort JSON node of the response, if any
* @param code The <a
* href="https://docs.fauna.com/fauna/current/reference/http/reference/errors/#error-codes">Fauna
* error code</a>.
* @param message A short, human-readable description of the
* error.
* @param constraintFailures The constraint failures for the error, if any.
* Only present if the error code is
* `constraint_failure`.
* @param abort A user-defined error message passed using an
* FQL `abort()` method call. Only present if the error
* code is `abort`.
*/
public ErrorInfo(
final String code,
Expand Down Expand Up @@ -142,7 +149,7 @@ public Optional<ConstraintFailure[]> getConstraintFailures() {
}

/**
* Gets the abort JSON node.
* Gets the user-defined abort error message as a JSON node.
*
* @return An optional TreeNode with the abort data.
*/
Expand Down

0 comments on commit 1fc6db2

Please sign in to comment.