Script exits with code 1 if ApplicationError is thrown