The logic of this modified error handler gets strange...  This else clause gets invoked in the case where there is no message, and could potentially change the behavior.  I don't actually know whether we ever invoke it with no arguments. But if so, it is supposed to show the prefix, but it won't anymore.

I suggest that you change handleError() to be very simple and just display the specified message with alert().

Then, move all of the youtube prefix code and the call to activity.postResult() into a new handleYoutubeError() function.  Your new code can use handleError, and the existing youtube code can use handleYoutubeError.