rem: throw new Error("no such item!"); 
add: throw new Components.Exception("no such item!"); 
context: calWcapCalendar.prototype.getItem = function( id, listener ){    // xxx todo: test    // xxx todo: howto detect whether to call    //           fetchevents_by_id ot fetchtodos_by_id?    //           currently drag/drop is implemented for events only,    //           try events first, fallback to todos... in the future...    this.log( ">>>>>>>>>>>>>>>> getItem() call!");    try {        var this_ = this;        var syncResponseFunc = function( wcapResponse ) {            var icalRootComp = wcapResponse.data; // first statement, may throw            var items = this_.parseItems(                icalRootComp,                Components.interfaces.calICalendar.ITEM_FILTER_ALL_ITEMS,                1, null, null );            if (items.length < 1)                throw new Error("no such item!");            if (items.length > 1) {                this_.notifyError(                    "unexpected number of items: " + items.length );            }            item = items[0];            if (listener != null) {                listener.onGetResult(                    this_.superCalendar, Components.results.NS_OK,                    Components.interfaces.calIItemBase,                    this_.log( "getItems_resp(): success." ),                    items.length, items );                listener.onOperationComplete(                    this_.superCalendar, Components.results.NS_OK,                    Components.interfaces.calIOperationListener.GET,                    items.length == 1 ? items[0].id : null, null );            }            this_.log( "item delivered." );        };                var params = ("&relativealarm=1&compressed=1&recurring=1" +                      "&fmt-out=text%2Fcalendar");        params += ("&calid=" + encodeURIComponent(this.calId));        params += ("&uid=" + id);        try {            // most common: event            this.session.issueSyncRequest(                this.session.getCommandUrl( "fetchevents_by_id" ) + params,                stringToIcal, syncResponseFunc );        }        catch (exc) {            // try again, may be a task:            this.session.issueSyncRequest(                this.session.getCommandUrl( "fetchtodos_by_id" ) + params,                stringToIcal, syncResponseFunc );        }    }    catch (exc) {        if (listener != null) {            listener.onOperationComplete(                this.superCalendar, Components.results.NS_ERROR_FAILURE,                Components.interfaces.calIOperationListener.GET,                null, exc );        }        this.notifyError( exc );    }    this.log( "getItem() returning." );};
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/88a347723b7a4696ebc1ec2a320d6f1fe7ff1a0b/calWcapCalendarItems.js/clean/calendar/providers/wcap/calWcapCalendarItems.js