Edit in JSFiddle

function getPromise(){
    return $.Deferred().promise();
}

try{
    getPromise().resolve("a");
}
catch(err){
    alert(err);
}