Skip to content

Commit

Permalink
add field name to an exception
Browse files Browse the repository at this point in the history
When a field is not set, i'd be nice to know what field it is - currently we are seeing just `Value cannot be null` and we start the scavenger hunt to find out what the field is.
Would be good to show field names for ever missing (null) field

Signed-off-by: Toli Kuznets <toli@harness.io>
  • Loading branch information
Toli Kuznets committed Apr 4, 2018
1 parent 4d001ed commit 1763f6e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public UpdateOperations<T> removeLast(final String field) {
@Override
public UpdateOperations<T> set(final String field, final Object value) {
if (value == null) {
throw new QueryException("Value cannot be null.");
throw new QueryException("Value for field [" + field + "] cannot be null.");
}

add(UpdateOperator.SET, field, value, true);
Expand Down

0 comments on commit 1763f6e

Please sign in to comment.