You could use following snippet:
UPDATED to take care of context
DEMO
jQuery.debug = true;
$ = function (selector, context) {
if (jQuery.debug && typeof selector === "string" && !jQuery(selector, context).length)
throw new Error("No element found!");
return jQuery.apply(this, arguments);
};