jjzjj

exceptions

全部标签

javascript - Testcafe - 在测试用异常(exception)测试命令行参数

随着我越来越熟悉Testcafe,我尝试使用命令行参数为用户提供有关如何运行测试的更多信息。出于这个原因,我正在使用minimist包。但是,我无法打印或使用测试用例之外的任何变量。请在下面找到我的代码。import{Selector}from'testcafe';importminimistfrom'minimist';constargs=minimist(process.argv.slice(2));constenv=args.env;console.log('***ASAMPLECONSOLEOUTPUT***');//doesnotprintfixture`GettingSta

javascript - Chrome : Print exception details to console

如何从我的代码中打印chromedevtools中异常的堆栈跟踪?我尝试了以下方法:functiondoSomething(){undefined();//Thisthrowsanexception}try{doSomething();}catch(e){console.error("Exceptionthrown",e);}但这会产生以下结果:ExceptionthrownTypeError{}如果我展开它旁边的箭头,它会将我指向进行console.error()调用的行,所以我看不到原始错误实际发生的位置。在控制台输出中包含原始错误信息(包括错误发生的确切位置的消息和完整堆栈跟踪)

javascript - Safari 扩展 : WebSocket connection failure calls onclose and not onerror and no exception

我正在为Firefox、Chrome和Safari编写浏览器扩展。当尝试使用没有服务器监听特定端口的Safari扩展连接到WebSocket服务器时,我的Safari扩展不会引发异常,也不会调用onerror。相反,正在调用Safari扩展的onclose处理程序。我还在控制台中看到此消息:[Error]WebSocketnetworkerror:Theoperationcouldn’tbecompleted.Connectionrefused(global.html,line0)在Firefox和Chrome上,它似乎可以正确处理它AFAIK并调用onerror。我只是在做这样的事情

asp.net - 使用 "Unknown Exception"取消页面卸载时为 "location.href"

我正在使用以下代码捕获window.onbeforeunload事件:window.onbeforeunload=function(evt){if(checkIsDirty()){varmessage='Ifyoucontinueyourchangeswillnotbesaved.';if(typeofevt=='undefined'){//IEevt=window.event;}if(evt){evt.returnValue=message;}else{returnmessage;}}}当我在确认结果中单击“取消”时,出现“未知异常”错误,调试器突出显示以下内容:onclick="l

javascript - QuotaExceededError (DOM Exception 22) : The quota has been exceeded on Safari in incognito

当我处于隐身模式时,我在Safari上收到QuotaExceededError(DOMException22):Thequotahasbeenexceeded.。我经历过类似的问题:QuotaExceededError:Domexception22:Anattemptwasmadetoaddsomethingtostoragethatexceededthequota但是他们谈论setItem,我在其他地方得到了这个错误。我在这一行收到此错误:localStorage['gallery.extensions']=JSON.stringify({});或localStorage['asdf

javascript - 两个站点上的 SECURITY_ERR : DOM Exception 18 when applying document. 域。我该如何解决这个问题?

我在内部服务器server1.mydomain.com/page.jsp有一个页面,在不同的内部服务器有另一个页面,10.x.x.x:8081/page.aspx。在server1.mydomain.com上,我在page.jsp中设置document.domain如下://page.jsponserver1.mydomain.comdocument.domain=document.domain;当我在document.domain上发出警报时,它显示为server1.mydomain.com。在10.x.x.x服务器上,我在page.aspx中设置了document.domain,结

javascript - 为什么 "[value=' ' ]"throw an exception in IE7 and ":not(:not([value ='' ]))"does not?

我正在尝试通过jQuery从选择框中选择选项标签(值为“”的选项)。我使用以下选择器:$("[value='']");这适用于大多数浏览器,但在IE7中它会抛出异常。如果我将其更改为以下(恕我直言)选择器,则它可以正常工作:$(":not(:not([value='']))");我宁愿不使用后者,但想不出更好的等价物。编辑:jQuery版本:1.3.1.异常:MicrosoftJScript运行时错误:抛出异常但未捕获在if(S==null){throw"Syntaxerror,unrecognizedexpression:"+ab}在哪里ab="value='']"测试设置:为确保我

javascript - WebKit 未捕获错误 : INVALID_STATE_ERR: DOM Exception 11

我有这段代码,在Firefox中运行良好,但在Chrome中我遇到了这个错误:"UncaughtError:INVALID_STATE_ERR:DOMException11"atsprites.js:36在那一行是这段代码:context.drawImage(Context是一个全局变量,其中包含Canvas的二维上下文。这是完整的代码:index.htmlSprite.jsfunctionSpritePrototype(frames,width,height,type){this.frames=frames;this.type=type;if(this.frames>0){this.

javascript - 通过 parentNode.removeChild 删除元素会抛出 DOM Exception 8

我的代码大致如下(我删除了一些不相关的部分):Library.focus=function(event){varelement,paragraph;element=event.srcElement;paragraph=document.createElement("p");paragraph.innerText=element.innerText;element.parentNode.insertBefore(paragraph,element);//Line#1element.parentNode.removeChild(element);//Line#2};我遇到的问题是,我编号为

c# - SignalR LongPolling multiple Groups.Add for a single client Exception

我已经为这个问题苦苦挣扎了一段时间。我们正在使用最新的SignalR2.0.3。当我们添加到多个SignalR组时会出现问题。仅当从具有不同组名的同一connectionId发生多次添加时才会抛出异常。TheexceptionisonlythrowniftheLongPollingtransportisselected.仅当您添加到6个以上的唯一组名称(5个或更少)并且它工作正常时才会抛出异常。这是一个简化的例子:索引.cshtml:@modelInt32?_testHub=$.connection.testHub;_testHub.client.sayHello=sayHello;$