Closed Bug 412817 Opened 16 years ago Closed 16 years ago

Improve ASSERT macro output or remove the macro

Categories

(Calendar :: Internal Components, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ssitter, Assigned: dbo)

References

Details

Currently the ASSERT macro output from calUtils.js is very useless compared to direct logging. The console output always looks like:

    Error: Assert failed: timezone not available: /BasicTimezones/GMT
    1: ASSERT
    2: newDateTime
    3: 
    4: 
    5: getItems
    Source File: file:///D:/sunbird/js/calUtils.js Line: 781

    Error: Assert failed: [calAlarmService] Could not determine
    alarm time for item: My task
    1: ASSERT
    2: 
    3: 
    4: onGetResult
    5: queueItems
    Source File: file:///D:/sunbird/js/calUtils.js Line: 781

Actual Results:
- The file and location where the error occurred is not visible from it
- The provided link just opens calUtils.js file where ASSERT is implemented
- one need to scan the stack trace to find a meaningful function name
- one need to search the code for the function definition and location
- if the function exists multiple times guess what function is the correct one (e.g. getItems from above is defined 8 times)
- one need to open the file, go to the function and search for the ASSERT location to the source code in question

Expected Results:
The error message contains the original file and location. Clicking on it opens the correct source file on the correct location.

Please improve the ASSERT macro output or remove the macro and just report to console directly.
Severity: minor → enhancement
The ASSERT macro now includes filenames and line numbers for each step, can we close this bug?
I think we can; anybody knows the bug those changes went in?
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.9
bug 393395
Status: RESOLVED → VERIFIED
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17pre) Gecko/2008082219 Calendar/0.9pre

While the output includes now more information it is still not usable. A typical output now looks like:

[[[
Error: Assert failed: An error was encountered preparing the calendar located at moz-profile-calendar:// for use. It will not be available.

1: [file:///E:/sunbird/components/calItemModule.js -> file:///E:/sunbird/js/calUtils.js:1004] ASSERT

2: [file:///E:/sunbird/components/calItemModule.js -> file:///E:/sunbird/js/calCalendarManager.js:560] cmgr_createCalendar

3: [file:///E:/sunbird/components/calItemModule.js -> file:///E:/sunbird/js/calCalendarManager.js:704] cmgr_assureCache

4: [file:///E:/sunbird/components/calItemModule.js -> file:///E:/sunbird/js/calCalendarManager.js:680] cmgr_getCalendars

5: [null:0] null

Source File: file:///E:/sunbird/components/calItemModule.js -> file:///E:/sunbird/js/calUtils.js
Line: 1009
]]]

It's still _NOT_ possible to open the correct source file from within the Error Console. All you get is an error like 

[[[
The file file:///E:/sunbird/components/calItemModule.js -> file:///E:/sunbird/js/calUtils.js cannot be found. Please check the location and try again.
]]]

Suggestion: Omit the useless "file:///.../calItemModule.js -> " prefix and log only the real location..
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
FWIW this sounds similar to what I've filed in bug 449673.
(In reply to comment #5)
> FWIW this sounds similar to what I've filed in bug 449673.

Stefan, can this bug be closed again?
Setting back to FIXED based on previous comments.
Status: REOPENED → RESOLVED
Closed: 16 years ago16 years ago
Depends on: 393395
Resolution: --- → FIXED
Assignee: nobody → daniel.boelzle
You need to log in before you can comment on or make changes to this bug.