问题标签 [uncaught-exception]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
4829 浏览

ios - 在 iOS 中发生未捕获的异常后,有什么方法可以执行代码?

我一直在为几个实现多级日志记录的应用程序开发一个框架。它主要用于内部用于测试与其他设备通信的应用程序,但也用于我们将分发的一些应用程序。

有什么方法可以捕获未捕获的异常并及时执行代码将异常保存到日志文件中?目前,Log 类只是每隔一段时间就写入文件,在写入失败的情况下在两个文件之间交替等。这工作正常,但如果它可以看到发生未处理的异常,写入任何未写入的日志,那就太好了记录到文件中,注意发生了异常并记录其详细信息,然后允许应用程序崩溃。

如果有某种方法可以在应用程序范围内捕获未处理的异常,我认为它会是这样的:

如果有人能给我关于这是否可能的见解或建议,将不胜感激。

0 投票
1 回答
1374 浏览

api - 致命错误:未捕获的异常“Zend_Gdata_App_HttpException”与

一个核心 php 网站与谷歌日历 API 集成。收集并更新到谷歌日历的网络表单数据。尽管所有日期格式都使用DATE_ATOM,mktime()我面临这个问题。

如何修复致命错误:未捕获的异常“Zend_Gdata_App_HttpException”?

致命错误:/home/website/public_html/zend/lib/Zend/Gdata/ 中未捕获的异常 'Zend_Gdata_App_HttpException' 和消息 'Expected response code 200, got 400 [Line 1, Column 659, element gd:when] Badly formatted datetime' App.php:700 堆栈跟踪:#0 /home/website/public_html/zend/lib/Zend/Gdata.php(219): Zend_Gdata_App->performHttpRequest('POST', ' http://www.goog ... ', Array, 'performHttpRequest('POST', ' http://www.goog ...', Array, 'post(Object(Zend_Gdata_Calendar_EventEntry), ' http://www.goog ...', NULL, NULL , 数组) #3 /home/website/public_html/zend/lib/Zend/Gdata/Calendar.php(165): Zend_Gdata_App->insertEntry(Object(Zend_Gdata_Calendar_EventEntry), ' http://www.goog...', 'Zend_Gdata_Cale...') #4 /home/website/public_html/add-session.php(297): Zend_Gdata_Calendar->insertEvent(Object(Zend_Gdata_C in /home/website/public_html/zend/lib/ Zend/Gdata/App.php 在第 700 行

以下链接都没有帮助我 未捕获的异常'Zend_Gdata_App_HttpException YouTube PHP API - Zend_Gdata_App_HttpException 致命错误:未捕获的异常'RuntimeException' 致命错误:PHPExcel 类中未捕获的异常'异常'

https://groups.google.com/forum/?fromgroups=#!topic/google-contacts-api/IFHANnTWzIM

0 投票
3 回答
1557 浏览

node.js - 在 node.js 中如何在处理 uncaughtException 中的一些异常时重新启动服务器

在我的应用程序中,我使用 uncaughtException 来处理应用程序错误。在此我如何重新启动服务器。

0 投票
1 回答
813 浏览

javascript - Uncaught SyntaxError:从自托管服务器迁移到托管服务器后出现意外令牌

大家好:我正在寻求帮助,而不是作为程序员,我相当决心找到解决应用程序问题的方法。我有一个建于 2009 年并在自托管服务器上实现的 Web 应用程序。我们最近决定关闭我们的服务器,因此我需要为该应用程序找一个新家,因此决定将其移至 Godaddy。

除了我认为我理解并将描述的一项功能外,大多数情况下都可以在应用程序上运行。

首先,应用程序实际上是两个共享信息的应用程序。一个是模型构建应用程序,我们在其中构建复杂的模型,这些模型成为配置产品的“外壳”。第二个应用程序使用“外壳”并引导最终用户完成配置产品功能和变量的过程。

就目前而言,应用程序的模型构建方面似乎工作正常。配置方面“大部分”有效。然而,我们在迁移到 GoDaddy 后创建的新 shell 在配置方面没有被正确读取。尽管可以编辑现有配置(它们位于配置端)并且功能都可以工作,但只有“新”模型(位于模型构建端)是看不到的。

这两个应用程序都托管在一个共享的豪华托管帐户 IIS6、ASP.NET 2 上。

创建新模型时,当配置端的用户选择构建新配置时,它会保存在模型目录中。配置应用程序应该读取该目录的内容并向用户提供一个模型列表以供选择配置。

在花费数小时寻找原因后,我认为问题与管理两个应用程序之间通信的那些功能特别相关。

使用 Chrome 时,我可以看到 Uncaught SyntaxError: Unexpected token {

任何想法或帮助解决此问题将不胜感激!

一些代码.... }

* Uncaught SyntaxError: Unexpected token { *

0 投票
1 回答
3309 浏览

objective-c - 由于未捕获的异常“NSInternalInconsistencyException”Xcode而终止应用程序

我最近重命名了我所有的 xcode 文件名和项目名称,它曾经被称为 HelloThere,我已将其更改为 BoatTracker,并相应地重命名了 .h、.m 和 xib 文件。我在 xcode 中使用了 refractor-rename 功能来做到这一点。我现在收到我认为与名称相关的错误。我已经尝试过注释发布声明并重置模拟器和我的 Iphone。我收到的错误是。

模拟器:所有输出

*** 首先抛出调用堆栈:

见模拟器图片: 在此处输入图像描述

IPhone:

*** 首先抛出调用堆栈:

看iphone图片: 在此处输入图像描述

如果您需要任何代码示例来帮助找到问题,请询问。

0 投票
1 回答
4728 浏览

jquery - jQuery TypeError: is not a function in Firefox on table object

I am using FireQuery in Firefox. Here is what I am trying to do:

  1. The text "Items Ordered" exists within a tag somewhere on the page.
  2. The table that "Items Ordered" text exists in is also nested deep within several other tables.

Given the above scenario, I want to grab the <table> tag closest to the aforementioned string, and append a div to it. My standard methodology to ensure I've grabbed the correct DOM element is to change the background color and give it a 1px border so that it pops out and is easily discernable on the page. However, with my code that failed. So, I'm trying to understand why it failed and how to fix it before proceeding to append the div.

Following is my code I used for testing:

[HTML -- Actual code, with substituted personal information & links]

Using

  • Firefox 20
  • Windows Vista Business 32-bit SP2
  • Firebug
  • Firequery
  • Google CDN-hosted jQuery

What I've found and why it was insufficient


A) No conflict

Many posts on the "is not an error" function indicate that the poster is using "$" instead of "jQuery" and have to do with setting no conflict mode as in this post. I don't believe this has anything to do with my issue, though the message is similar, because how I'm implementing jQuery is from FireQuery's "jQueryify" function. Also, I'm already using "jQuery" instead of "$".

B) jQuery versions issues

I also started to suspect the issue may be related to jQuery versions. As of this writing, version 2.0.0 was just released 3 days ago (Apr 18, 2013), and version 1.9.0 is already known to be significantly different from previous versions (including deprecating several popular functions), such that any code using the previous jQuery versions may need to be reworked, either manually or using the Migrate tool.

Results

So, I tested my code with KOMODO IDE 6.1.3 to eliminate any issues with how FireQuery implements jQuerify. I used three popular versions of jQuery; here are the results of my cross-browser tests:

C) Wrap target element with div

In my code I threw in something to return the type of object. This is what I used:

It returns "table", so I know I DO indeed have an html element.

Then I figured maybe since the table element is anonymous (no id or name) that was what was causing the problem? To resolve that I tried to wrap the target tag in a div thusly:

However, it only returned the same "not a function" error, but this time referencing the wrap() method. I verified that "wrap()" is INDEED a valid jQuery function.

D) Other thoughts

This post mentions that Chrome's version of the "Not a Function" error is the "Uncaught TypeError" error. It suggests multiple instances of jQuery on the same page as a possible cause. Again, this has to do with noConflict, and I'm not exactly certain if this applies to me or not, though I'm leaning towards 'not'.

The only other thing I could come up with is that maybe the issue has somehting to do with discrepancies and differentiation and differences between jQuery objects, DOM objects, and JavaScript objects?

During the process of starting to post this, I found this jQuery post which may be relevant, but I can't understand it. It seems to recommend implementation of some plugin or package -- how can I tell if this is just someone trying to promote their code, or if it is an actual, "best practice", accepted module?

0 投票
1 回答
3643 浏览

javascript - AmCharts 内联代码未捕获的引用错误

在我的 HTML <body> 中,我像这样编写 Amcharts 内联脚本:

在页面末尾我包含 js 文件

但在浏览器控制台中,我收到此错误:

此错误指向AmCharts.ready(function () {. 似乎浏览器在到达 amcharts.ready 行时找不到 AmCharts。当我在页面的 <head> 标记中包含 amcharts.js 文件时,一切正常。但我想将它包含在页面底部。

我必须将所有内联脚本移动到 HTML 文件的末尾,还是有更好的解决方案不会改变我的内联脚本位置?

0 投票
2 回答
301 浏览

linux - Node.js 未捕获的异常

根据许多文章,在 node.js 应用程序中处理未捕获异常的最佳方法是让进程崩溃然后重新启动它。这避免了我们的应用程序处于不稳定状态。我认为它可以通过像看门狗这样的外部进程(有时称为天使进程)来完成。在 linux 系统中执行此操作的最佳方法是什么?乍一看,每 n 秒检查一次节点进程状态的 bash 脚本可能是一种可能的解决方案。在此先感谢,任何建议将不胜感激。

Node.js 最佳实践异常处理

http://shapeshed.com/uncaught-exceptions-in-node/

http://debuggable.com/posts/node-js-dealing-with-uncaught-exceptions:4c933d54-1428-443c-928d-4e1ecbdd56cb

0 投票
0 回答
587 浏览

ruby-on-rails - 未找到未定义的模板

嗨,我正在编写一个教程,并扩展了我在这里遇到的一个问题 -主干 + rails TypeError: List.Header is not a constructor

我修复了我最初在旧问题中遇到的问题,但是我有一个新错误(我在 chrome 控制台中看到):

firebug 控制台中也会出现类似的消息。

我不仅收到此错误,而且现在控制台中不会显示“页眉”消息 - 页面上也看不到页脚和页眉(在我至少可以看到页脚之前)。

list_controller.js.coffee

list_view.js.coffee

header_app.js.coffee

list_header.jst.eco

这是定义错误的文件:

骨干/配置/木偶/renderer.js.coffee

我将上述所有行都注释掉了(实质上是删除了文件)——我得到了错误(chrome 控制台):

它可能与“路径”变量有关吗?HeaderApp 和 FooterApp 都在目录下的“header”和“footer”文件夹中:app/assets/javascripts/backbone/apps

0 投票
1 回答
1409 浏览

php - PHP:致命错误:未捕获的异常“ActiveRecord\RecordNotFound”

我正在尝试活动记录。我相信这是一个很棒的 ORM,但是我无法让它运行。

有些方法有效,但其他方法无效 例如

但是,当提供选项或使用 validates_uniqueness_of 时,会引发异常:

这导致

...带有消息...

我正在使用 php 5.3.4 并使用夜间构建(2013 年 5 月 8 日)请告知如何解决此问题。