2

What query.getFirst() really returns?

Retrieves at most one ParseObject that satisfies this query. Uses the network and/or the cache, depending on the cache policy. This mutates the ParseQuery. Returns: A ParseObject obeying the conditions set in this query, or null if none found. Throws: ParseException - Throws a ParseException if no object is found.

First is saying that returns null of the object is not found. After that it says that there will be an exception of object not found..

What it really does?

Thanks.

2
  • 1
    Just ran into the same bug. Documentation and/or behavior should be fixed. Commented Jan 17, 2015 at 16:00
  • I opened a bug report Commented Jan 19, 2015 at 14:17

1 Answer 1

2

Method throws ParseException, tested on Parse-1.7.1 SDK

e = {com.parse.ParseException@831697061768}"com.parse.ParseException: no results found for query"
code = 101
cause = {com.parse.ParseException@831697061768}"com.parse.ParseException: no results found for query"
detailMessage = {java.lang.String@831697061808}"no results found for query"
stackState = {int[266]@831697061912}
stackTrace = {java.lang.StackTraceElement[0]@831693444272}
suppressedExceptions = {java.util.Collections$EmptyList@831693442224} size = 0
Sign up to request clarification or add additional context in comments.

1 Comment

Work around for me was to catch ParseException and see if e.getCode() == ParseException.OBJECT_NOT_FOUND

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.