Titanium JIRA Archive
Appcelerator Community (AC)

[AC-105] Try catch not working and cause crash

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNot Our Bug
Resolution Date2015-11-10T06:06:09.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsios, regression
ReporterYoann WYFFELS
AssigneeMostafizur Rahman
Created2015-04-28T08:23:13.000+0000
Updated2015-11-10T06:06:09.000+0000

Description

[Link to Q&A](http://developer.appcelerator.com/question/182008/ios-simulator-close-because-not-valid-the-try--catch) have this try in my code:
try {
    var checkPedidoColumn = db.execute('ALTER TABLE pedido_item ADD COLUMN "min_tamanho" NUMERIC');
} catch(e) {
    Ti.API.info('the column min_tamanho exists in the table pedido_item');
}
This table and column exists and try this ok, until the iOS 8.3. Now the titanium return: A SQLite database error occurred on database '/Users/maicocardoso/Library/Developer/CoreSimulator/Devices/B7AFD1AF-767E-42CD-A370-C2D904417918/data/Containers/Data/Application/C1F57F5A-311C-48A1-8042-1C1FEEC20DED/Library/Private Documents/database3.sql': Error Domain=com.plausiblelabs.pldatabase Code=3 "An error occured parsing the provided SQL statement." UserInfo=0x797aea90 {com.plausiblelabs.pldatabase.error.vendor.code=1, NSLocalizedDescription=An error occured parsing the provided SQL statement., com.plausiblelabs.pldatabase.error.query.string=ALTER TABLE pedido_item ADD COLUMN "min_tamanho" NUMERIC, com.plausiblelabs.pldatabase.error.vendor.string=duplicate column name: min_tamanho} (SQLite #1: duplicate column name: min_tamanho) (query: 'ALTER TABLE pedido_item ADD COLUMN "min_tamanho" NUMERIC') Falling back to SDK 3.4.1, try catch work again as expected.

Comments

  1. Radamantis Torres-Lechuga 2015-04-28

    [~yoannwyffels] can you please add a test case that can reproduce this issue? Please attach it to this ticket Best
  2. Maico Cardoso 2015-05-01

    The problem is when building for iOS simulator iPad 2 and Retina if building for iOS iPad simulator Air or Resizable iPad does not occur any problem.
  3. Ingo Muschenetz 2015-05-18

    So, to confirm: Bad: * iOS simulator iPad 2 * Retina iPad 4? Good: * iOS iPad simulator Air * Resizable iPad What versions of iOS are you using? All 8.3?
  4. Amimul Hossain 2015-09-16

    Hello [~maicojc], Are you still facing this issue in Appcelerator. Use Appcelerator Studio, build: 4.1.1.201507141126, and SDK 4.1.1.GA. Please reply. Thanks.
  5. Maico Cardoso 2015-09-16

    I'm using the ios version 8.4 and no longer the problem. Thank you.

JSON Source