[AC-4748] Missing database error/warnings console logs
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Duplicate |
Resolution Date | 2018-03-30T08:21:20.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Ricardo Pereira |
Assignee | Shak Hossain |
Created | 2017-01-20T12:16:49.000+0000 |
Updated | 2018-03-30T08:23:28.000+0000 |
Description
Missing all the console logs from database query errors and warnings.
Try it:
var db = Ti.Database.open("myDbName"),
fieldset,
queries = [
"SELECT * FROM someUnexistingTable",
"SELECT 'test' AS testColumn",
"32 some random strs 2352 ojndslk",
"other some random data sfgfs 23r g f",
];
db && queries.forEach(function(query) {
console.log(query);
Ti.API.info(query);
try {
console.log("TRY");
Ti.API.info("TRY");
fieldset = db.execute(query);
console.log(fieldset);
Ti.API.info(fieldset);
}
catch(e) {
console.log("ERROR");
Ti.API.info("ERROR");
console.log(e);
Ti.API.info(e);
}
query = null;
});
db.close();
db = null;
Thanks to [~psheth] for his time and help
Hey Ricardo, so logs outside the loop work? [~cbarber] might have a guess here!
[~hansknoechel], yes, all logs work, the ones that doesn't work are placed inside the catch. I'f you run a query without the exception handling (try, catch) it's supposed to throw the development red error, but it doesn't. Basically it's the Ti.Database.DB *execute* method that doesn't throw an error if something is wrong with the query
Gotcha. It should throw, at least the iOS source indicates that. Do you having his on iOS or Android?
Hello, I can see the error in Android. But the error doesn't show in iOS. See my test log. iOS
Android
This is still happening here. I've formatted another *MacBook Pro (Retina, 13-inch, Early 2015)* with *macOS Sierra*. Install the *latest Axway Appcelerator* version, with *Titanium SDK 7.1.0.GA* *Operating System* {noformat} Name = Mac OS X Version = 10.12.6 Architecture = 64bit # CPUs = 4 Memory = 8.0GB {noformat} *Node.js* {noformat} Node.js Version = 9.9.0 npm Version = 5.6.0 {noformat} *Appcelerator CLI* {noformat} Installer = 4.2.12 Core Package = 7.0.2 {noformat} *Titanium CLI* {noformat} CLI Version = 5.0.14 node-appc Version = 0.2.41 {noformat} *Titanium SDKs* {noformat} 7.1.0.GA Version = 7.1.0 Install Location = /Users/rjcpereira/Library/Application/Support/Titanium/mobilesdk/osx/7.1.0.GA Platforms = iphone, android git Hash = df92fbf git Timestamp = 3/14/2018 20:46 node-appc Version = 0.2.43 {noformat}
This ticket was indeed valid and AC-5685 was created to stand up for the issue. Thanks [~ricardo_jcp]! As discussed in the other ticket, it's a duplicate of TIMOB-25906 and already has an open fix ready today, to be included in the official SDK 7.2.0. See the other tickets for details.