Welcome Guest. Sign in or Signup

2 Answers

Difference between Exit(1) and Exit(0)?

Asked by: 24245 views PeopleCode

In an App Engine PeopleCode, it’s not uncommon to see code that works on the following logic.
You have a condition and if it’s TRUE, you want Exit(1) to execute.
If the condition is FALSE, you would like Exit(0) to execute.
Depending on the way in which you have designed the App Engine, this can completely change its flow.

Can you explain what is the difference between Exit(1) and Exit(0)?

Related Questions

2 Answers



  1. Ananya Das on Mar 06, 2013 Reply

    Exit(1) : Terminate the AE immediately and rollback all DB changes made
    exit(0) : Terminate the AE immediately but will not rollback the DB changes made.

    -55 Votes Thumb up 0 Votes Thumb down 0 Votes



  2. Ravi on Apr 05, 2013 Reply

    This is my understanding –
    Any non-zero return code is some kind of error. The way it will be handled depends on “On Return” value for each step of application engine.

    So exit(0) – is success

    exit(1) and On Return = Abort – is error and exit program immediately
    exit(1) and On Return = Break – is exit current step and section
    exit(1) and On Return = Skip Step – exits current step, continue with next step

    +120 Votes Thumb up 0 Votes Thumb down 0 Votes


Answer Question