Skip to main content
Inspiring
November 21, 2014
Question

While inside try/catch...

  • November 21, 2014
  • 1 reply
  • 259 views

I have this method:

private function rewriteQueue():void {

  try{

    var file:File = File.applicationStorageDirectory.resolvePath( DATA_FILE_NAME );

    file.deleteFile();

   while (users.length) {

     var aUser:Object = users.shift();

     writeUser(aUser);

    }

   }catch (e:Error) {

   }

}

That doesn't work and I'm just not sure why. Putting the while outside of the try/catch fixes it... but why?

This topic has been closed for replies.

1 reply

dmennenohAuthor
Inspiring
November 21, 2014

OK, I figured out why the problem was occurring. It happened when there was no file to delete - the deleteFile() failed - also causing the while to not execute. My bad.