Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18131] iOS: When an application error is thrown no reason is given

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2014-12-17T19:57:51.000+0000
Affected Version/sRelease 3.5.0
Fix Version/sRelease 3.5.0, Release 4.0.0
ComponentsiOS
Labelsqe-3.5.0, regression
ReporterEwan Harris
AssigneeVishal Duggal
Created2014-12-03T23:39:56.000+0000
Updated2014-12-17T19:57:51.000+0000

Description

Description

When an error is thrown using the 3.5.0 SDK the following is printed out in the console
[ERROR] :  Script Error {
[ERROR] :      column = 11;
[ERROR] :      line = 8;
[ERROR] :      sourceURL = "file:///private/var/mobile/Containers/Bundle/Application/8E9433FD-3F80-4060-8BBB-2C1C249744CB/TIMOB-10501.app/app.js";
[ERROR] :      stack = "global code@file:///private/var/mobile/Containers/Bundle/Application/8E9433FD-3F80-4060-8BBB-2C1C249744CB/TIMOB-10501.app/app.js:8:11";
[ERROR] :  }
In the error logs in the console there should be a message telling the user where the error is as shown when using 3.4.1.GA SDK
[ERROR] :  Script Error {
[ERROR] :      backtrace = "#0 () at :0";
[ERROR] :      line = 8;
[ERROR] :      message = "'undefined' is not a function (evaluating 'win.foobar()')";
[ERROR] :      name = TypeError;
[ERROR] :      sourceId = 48024064;
[ERROR] :      sourceURL = "file:///private/var/mobile/Containers/Bundle/Application/E979FC89-452D-43B9-85F5-32FE7920445B/TIMOB-10501.app/app.js";
[ERROR] :  }
This *is a regression* as context is given in 3.4.1.GA On the device there are also differences, see the attached images for examples of these.

Steps To Reproduce

1. Add the code below to an exisiting project and run the project on a device or sim
Titanium.UI.setBackgroundColor('#000');
  
var win = Titanium.UI.createWindow({ 
    title: 'test'
});
  
var obj = require('module')();
win.foobar();


win.open();

Actual Result

The app will crash and will only show a reference to the line numbers rather than providing context

Expected Result

The app will crash and should provide context, e.g. it should say "message = "'undefined' is not a function (evaluating 'e.foobar()')";"

Attachments

FileDateSize
3.4.1.PNG2014-12-03T23:39:56.000+0000124770
3.5.0.PNG2014-12-03T23:39:56.000+0000107061

Comments

  1. Ingo Muschenetz 2014-12-03

    [~jalter] [~pec1985] [~mlangston] [~vduggal] FYI
  2. Vishal Duggal 2014-12-08

    Pull pending https://github.com/appcelerator/tijscore/pull/19
  3. Ewan Harris 2014-12-10

    Verified fix on: Mac OSX 10.10.1 Appcelerator Studio, build: 3.4.1.201410281743 Titanium SDK build: 3.5.0.v20141208122514 Titanium CLI, build: 3.4.1 Alloy: 1.5.1 Xcode 6.1.1 iPhone 6 Plus (8.1), iPhone 6 Simulator (8.1), iPhone 5s (7.1.1)
       //var cloud = require('ti.cloud');
       var x = y;
       Titanium.UI.setBackgroundColor('#fff');  
       var win = Titanium.UI.createWindow({title: 'test'}); 
       //win.foobar();
       win.open();
       
    Using the code above, built to device and sim. Each time the application included the correct information was included in the application error screen and the console log (see example log below).
       [ERROR] :  Script Error {
       [ERROR] :      column = 10;
       [ERROR] :      line = 3;
       [ERROR] :      message = "Can't find variable y";
       [ERROR] :      sourceURL = "file:///private/var/mobile/Containers/Bundle/Application/A181D005-7B8E-4E6B-A34D-39593215B14F/Testy.app/app.js";
       [ERROR] :      stack = "global code@file:///private/var/mobile/Containers/Bundle/Application/A181D005-7B8E-4E6B-A34D-39593215B14F/Testy.app/app.js:3:10";
       [ERROR] :  }
       
    The following was what was tried: * Require ti.cloud and not add it to tiapp.xml * Undefined function (view.foobar) * Undefined variable (var x = y) Closing ticket.
  4. Eric Merriman 2014-12-17

    Reopening to add affects version

JSON Source