1 Reply Latest reply on May 23, 2010 6:47 PM by losing

    Error #1056: Cannot create property stackTrace on flash.errors.SQLError.

    losing

      I'm using a user's password to encrypt the local SQLite database.  Thus I need to be able to try and open a database with an encryption key, and catch an error if the password is wrong.  Here is a simple version of the code.

       

      try {
           var connection = new air.SQLConnection();
           var key = new air.ByteArray();
           key.writeUTFBytes(password);
           connection.open(air.File.applicationStorageDirectory.resolvePath(path), air.SQLMode.CREATE, false, 1024, key);
       } catch (e) {
           // password incorrect
       }
      

       

      However, when I try to catch the SQLError that is thrown when opening a database with the wrong encryption key, I get the following error:

       

       

      ReferenceError: Error #1056: Cannot create property stackTrace on flash.errors.SQLError.

       

       

      Any idea what is going on here?  Is there a better approach I can take to this problem?

       

      My guess is that Javascript is trying to modify the SQLError by adding a stack trace and for whatever reason the stackTrace property does not exist in the prototype.