User:Tgr (WMF)/common.js

function makeError { throw new Error( 'custom error' ); }

$( function {	window.onerror = function ( msg, file, line, col, e ) {		alert( msg + '\n' + file + '\n' + line + '\n' + col + '\n' + e );	};	$( mw.util.addPortletLink( 'p-tb', '#', 'make error', 't-makeerr' ) ).click( function( e ) { e.preventDefault; makeError; } ); } );