2

My app is running on parse.com and all the cloudcode errors have code 141.

When I'm running a certain function, in some rare cases I get this exception trown by the cloudcode: Error: User isn't in the database. (Code: 141, Version: 1.2.19)

However, when I'm trying to segue the user back to the home screen with this code, nothing gets called:

if(error){
   NSLog(@"Error logged: %@", error); //loggs: Error logged refreshtokencoinbase: Error Domain=Parse Code=141 "The operation couldn’t be completed. (Parse error 141.)" UserInfo=0x10ae0e460 {error=User isn't in the database., code=141}

   if([error  isEqual:@"User isn't in the database." ]){
       [self performSegueWithIdentifier:@"moveToStart" sender:self];
   }
}

How do I handle cloudcode generated errors like this one?

2
  • 1
    What about comparing it to error.userInfo[@"error"]? Commented Aug 2, 2014 at 17:53
  • @knshn wheh that worked! Thanks so much! If you answer my question I'll accept it. Commented Aug 2, 2014 at 19:19

1 Answer 1

1

Parse errors have the description text in error.userInfo[@"error"]. It may not be a good idea to check the error type by the text, but here you have no other chance.

Sign up to request clarification or add additional context in comments.

Comments

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.