mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
universe_wsgi.ini, then: - A middleware will be installed that send thrown exceptions to sentry - All logging messages of level WARN and above will be sent to sentry - All pages extending base/base_panels will have javascript errors captured and sent to sentry
1 line
9.5 KiB
JavaScript
1 line
9.5 KiB
JavaScript
(function(h,d){var e={};var j=h.TraceKit;e.noConflict=function g(){h.TraceKit=j;return e};e._has=function a(k,l){return Object.prototype.hasOwnProperty.call(k,l)};e.report=(function i(){var k=[],o=null,q=null;function l(t){k.push(t)}function r(u){for(var t=k.length-1;t>=0;--t){if(k[t]===u){k.splice(t,1)}}}function p(t,v){var x=null;if(v&&!e.collectWindowErrors){return}for(var w in k){if(e._has(k,w)){try{k[w].apply(null,[t].concat(Array.prototype.slice.call(arguments,2)))}catch(u){x=u}}}if(x){throw x}}var s=h.onerror;h.onerror=function n(w,v,x){var t=null;if(q){e.computeStackTrace.augmentStackTraceWithInitialElement(q,v,x,w);t=q;q=null;o=null}else{var u={url:v,line:x};u.func=e.computeStackTrace.guessFunctionName(u.url,u.line);u.context=e.computeStackTrace.gatherContext(u.url,u.line);t={mode:"onerror",message:w,url:document.location.href,stack:[u],useragent:navigator.userAgent}}p(t,"from window.onerror");if(s){return s.apply(this,arguments)}return false};function m(v){var u=Array.prototype.slice.call(arguments,1);if(q){if(o===v){return}else{var w=q;q=null;o=null;p.apply(null,[w,null].concat(u))}}var t=e.computeStackTrace(v);q=t;o=v;h.setTimeout(function(){if(o===v){q=null;o=null;p.apply(null,[t,null].concat(u))}},(t.incomplete?2000:0));throw v}m.subscribe=l;m.unsubscribe=r;return m}());e.computeStackTrace=(function b(){var u=false,q={};function l(D){if(!e.remoteFetching){return""}try{var C;if(typeof(XMLHttpRequest)==="undefined"){C=function E(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(H){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(H){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(H){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(H){}throw new Error("No XHR.")}}else{C=XMLHttpRequest}var F=new C();F.open("GET",D,false);F.send("");return F.responseText}catch(G){return""}}function t(C){if(!e._has(q,C)){var D;if(C.indexOf(document.domain)!==-1){D=l(C)}else{D=[]}q[C]=D.length?D.split("\n"):[]}return q[C]}function z(D,F){var J=/function ([^(]*)\(([^)]*)\)/,G=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,K="",I=10,C=t(D),E;if(!C.length){return"?"}for(var H=0;H<I;++H){K=C[F-H]+K;if(K!==d){if((E=G.exec(K))){return E[1]}else{if((E=J.exec(K))){return E[1]}}}}return"?"}function B(E,K){var D=t(E);if(!D.length){return null}var G=[],J=Math.floor(e.linesOfContext/2),C=J+(e.linesOfContext%2),F=Math.max(0,K-J-1),H=Math.min(D.length,K+C-1);K-=1;for(var I=F;I<H;++I){if(typeof(D[I])!=="undefined"){G.push(D[I])}}return G.length>0?G:null}function m(C){return C.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function x(C){return m(C).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function o(F,H){var G,C;for(var E=0,D=H.length;E<D;++E){if((G=t(H[E])).length){G=G.join("\n");if((C=F.exec(G))){return{url:H[E],line:G.substring(0,C.index).split("\n").length,column:C.index-G.lastIndexOf("\n",C.index)-1}}}}return null}function A(F,E,D){var H=t(E),G=new RegExp("\\b"+m(F)+"\\b"),C;D-=1;if(H&&H.length>D&&(C=G.exec(H[D]))){return C.index}return null}function v(H){var N=[h.location.href],I=document.getElementsByTagName("script"),L,F=""+H,E=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,G=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,P,J,Q;for(var K=0;K<I.length;++K){var O=I[K];if(O.src){N.push(O.src)}}if(!(J=E.exec(F))){P=new RegExp(m(F).replace(/\s+/g,"\\s+"))}else{var D=J[1]?"\\s+"+J[1]:"",M=J[2].split(",").join("\\s*,\\s*");L=m(J[3]).replace(/;$/,";?");P=new RegExp("function"+D+"\\s*\\(\\s*"+M+"\\s*\\)\\s*{\\s*"+L+"\\s*}")}if((Q=o(P,N))){return Q}if((J=G.exec(F))){var C=J[1];L=x(J[2]);P=new RegExp("on"+C+"=[\\'\"]\\s*"+L+"\\s*[\\'\"]","i");if((Q=o(P,N[0]))){return Q}P=new RegExp(L);if((Q=o(P,N))){return Q}}return null}function w(J){if(!J.stack){return null}var I=/^\s*at (?:((?:\[object object\])?\S+) )?\(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,C=/^\s*(\S*)(?:\((.*?)\))?@((?:file|http|https).*?):(\d+)(?::(\d+))?\s*$/i,L=J.stack.split("\n"),K=[],F,H,D=/^(.*) is undefined$/.exec(J.message);for(var G=0,E=L.length;G<E;++G){if((F=C.exec(L[G]))){H={url:F[3],func:F[1]||"?",args:F[2]?F[2].split(","):"",line:+F[4],column:F[5]?+F[5]:null}}else{if((F=I.exec(L[G]))){H={url:F[2],func:F[1]||"?",line:+F[3],column:F[4]?+F[4]:null}}else{continue}}if(!H.func&&H.line){H.func=z(H.url,H.line)}if(H.line){H.context=B(H.url,H.line)}K.push(H)}if(K[0]&&K[0].line&&!K[0].column&&D){K[0].column=A(D[1],K[0].url,K[0].line)}if(!K.length){return null}return{mode:"stack",name:J.name,message:J.message,url:document.location.href,stack:K,useragent:navigator.userAgent}}function s(H){var J=H.stacktrace;var G=/ line (\d+), column (\d+) in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,L=J.split("\n"),I=[],C;for(var F=0,D=L.length;F<D;F+=2){if((C=G.exec(L[F]))){var E={line:+C[1],column:+C[2],func:C[3]||C[4],args:C[5]?C[5].split(","):[],url:C[6]};if(!E.func&&E.line){E.func=z(E.url,E.line)}if(E.line){try{E.context=B(E.url,E.line)}catch(K){}}if(!E.context){E.context=[L[F+1]]}I.push(E)}}if(!I.length){return null}return{mode:"stacktrace",name:H.name,message:H.message,url:document.location.href,stack:I,useragent:navigator.userAgent}}function p(U){var E=U.message.split("\n");if(E.length<4){return null}var G=/^\s*Line (\d+) of linked script ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,F=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,C=/^\s*Line (\d+) of function script\s*$/i,L=[],I=document.getElementsByTagName("script"),T=[],P,R,S,Q;for(R in I){if(e._has(I,R)&&!I[R].src){T.push(I[R])}}for(R=2,S=E.length;R<S;R+=2){var V=null;if((P=G.exec(E[R]))){V={url:P[2],func:P[3],line:+P[1]}}else{if((P=F.exec(E[R]))){V={url:P[3],func:P[4]};var D=(+P[1]);var W=T[P[2]-1];if(W){Q=t(V.url);if(Q){Q=Q.join("\n");var K=Q.indexOf(W.innerText);if(K>=0){V.line=D+Q.substring(0,K).split("\n").length}}}}else{if((P=C.exec(E[R]))){var J=h.location.href.replace(/#.*$/,""),M=P[1];var O=new RegExp(x(E[R+1]));Q=o(O,[J]);V={url:J,line:Q?Q.line:M,func:""}}}}if(V){if(!V.func){V.func=z(V.url,V.line)}var H=B(V.url,V.line);var N=(H?H[Math.floor(H.length/2)]:null);if(H&&N.replace(/^\s*/,"")===E[R+1].replace(/^\s*/,"")){V.context=H}else{V.context=[E[R+1]]}L.push(V)}}if(!L.length){return null}return{mode:"multiline",name:U.name,message:E[0],url:document.location.href,stack:L,useragent:navigator.userAgent}}function y(G,E,H,F){var D={url:E,line:H};if(D.url&&D.line){G.incomplete=false;if(!D.func){D.func=z(D.url,D.line)}if(!D.context){D.context=B(D.url,D.line)}var C=/ '([^']+)' /.exec(F);if(C){D.column=A(C[1],D.url,D.line)}if(G.stack.length>0){if(G.stack[0].url===D.url){if(G.stack[0].line===D.line){return false}else{if(!G.stack[0].line&&G.stack[0].func===D.func){G.stack[0].line=D.line;G.stack[0].context=D.context;return false}}}}G.stack.unshift(D);G.partial=true;return true}else{G.incomplete=true}return false}function n(J,H){var I=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,K=[],D={},F=false,G,L,C;for(var N=n.caller;N&&!F;N=N.caller){if(N===r||N===e.report){continue}L={url:null,func:"?",line:null,column:null};if(N.name){L.func=N.name}else{if((G=I.exec(N.toString()))){L.func=G[1]}}if((C=v(N))){L.url=C.url;L.line=C.line;if(L.func==="?"){L.func=z(L.url,L.line)}var E=/ '([^']+)' /.exec(J.message||J.description);if(E){L.column=A(E[1],C.url,C.line)}}if(D[""+N]){F=true}else{D[""+N]=true}K.push(L)}if(H){K.splice(0,H)}var M={mode:"callers",name:J.name,message:J.message,url:document.location.href,stack:K,useragent:navigator.userAgent};y(M,J.sourceURL||J.fileName,J.line||J.lineNumber,J.message||J.description);return M}function r(D,F){var C=null;F=(F==null?0:+F);try{C=s(D);if(C){return C}}catch(E){if(u){throw E}}try{C=w(D);if(C){return C}}catch(E){if(u){throw E}}try{C=p(D);if(C){return C}}catch(E){if(u){throw E}}try{C=n(D,F+1);if(C){return C}}catch(E){if(u){throw E}}return{mode:"failed"}}function k(D){D=(D==null?0:+D)+1;try{throw new Error()}catch(C){return r(C,D+1)}return null}r.augmentStackTraceWithInitialElement=y;r.guessFunctionName=z;r.gatherContext=B;r.ofCaller=k;return r}());(function f(k){var l=function l(o){var n=k[o];k[o]=function m(){var p=Array.prototype.slice.call(arguments,0);var r=p[0];if(typeof(r)==="function"){p[0]=function q(){try{r.apply(this,arguments)}catch(s){e.report(s);throw s}}}if(n.apply){return n.apply(this,p)}else{return n(p[0],p[1])}}};l("setTimeout");l("setInterval")}(h));(function c(q){if(!q){return}var p=q.event.add;q.event.add=function n(w,u,v,x,r){var s;if(v.handler){s=v.handler;v.handler=function t(){try{return s.apply(this,arguments)}catch(z){e.report(z);throw z}}}else{s=v;v=function y(){try{return s.apply(this,arguments)}catch(z){e.report(z);throw z}}}if(s.guid){v.guid=s.guid}else{v.guid=s.guid=q.guid++}return p.call(this,w,u,v,x,r)};var l=q.fn.ready;q.fn.ready=function k(r){var s=function(){try{return r.apply(this,arguments)}catch(t){e.report(t);throw t}};return l.call(this,s)};var o=q.ajax;q.ajax=function m(x){if(q.isFunction(x.complete)){var v=x.complete;x.complete=function u(){try{return v.apply(this,arguments)}catch(s){e.report(s);throw s}}}if(q.isFunction(x.error)){var r=x.error;x.error=function z(){try{return r.apply(this,arguments)}catch(s){e.report(s);throw s}}}if(q.isFunction(x.success)){var w=x.success;x.success=function t(){try{return w.apply(this,arguments)}catch(s){e.report(s);throw s}}}try{return o.call(this,x)}catch(y){e.report(y);throw y}}}(h.jQuery));if(!e.remoteFetching){e.remoteFetching=true}if(!e.collectWindowErrors){e.collectWindowErrors=true}if(!e.linesOfContext||e.linesOfContext<1){e.linesOfContext=11}h.TraceKit=e}(window)); |