Custom Code deleteGame Error

0 votes
Hi, gameService.deleteGame Error Game Create Delete the entire code. It should be deleted.
public class GameCreateDeleteTest implements Executor 
{
    private ServiceAPI sp = new ServiceAPI(    Constants.App42ApiKey, Constants.App42ApiSecret);
    private final int HTTP_STATUS_SUCCESS = 200;
    private String moduleName = "GameCreateDeleteTest";    
    @Override
    public HttpResponseObject execute(HttpRequestObject request) {
        JSONObject body = request.getBody();LogService logger = sp.buildLogService();Game game = null;String rankName = "testGame";GameService gameService = sp.buildGameService();
        ArrayList<Game> gameList = gameService.getAllGames();
        for( int i = 0; i<gameList.size(); i++)       {
            if( gameList.get(i).name.equals(rankName) )            {
                try{
                    App42Response app42Response = gameService.deleteGame(rankName);
                }catch (App42Exception ee)                {
                    logger.debug("App42Exception deleteGame: " + ee.toString(), moduleName);}            }        }
        try{                
            game = gameService.createGame( rankName, "des: " + rankName );        }        catch (App42Exception ee){}
 
        JSONObject jsonResponse = new JSONObject();
 
        try {            jsonResponse.put("moduleName",  moduleName );        } catch (JSONException e) {}
        return new HttpResponseObject(HTTP_STATUS_SUCCESS, jsonResponse);}}

 

asked Jan 14, 2016 in App42 Cloud API-BaaS by airfighter.pilot (10 points)

1 Answer

0 votes

Hello Developer,

 

We believe your query has been resolved here. If you still face any issue, then let us know.

We are happy to address your concern,

 

Regards,

Himanshu Sharma

answered Jan 14, 2016 by hs00105 (2,005 points)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...