Tag: 线程exception

什么是一个“抛出”的声明呢?

这些天,我一直在阅读很多C ++常见问题 ,尤其是这个页面 。 通过阅读本节,我发现了一种作者称之为“exception调度程序”的“技术”,它允许某人将他的所有exception处理组合在一个便利的函数中: void handleException() { try { throw; // ?! } catch (MyException& e) { //…code to handle MyException… } catch (YourException& e) { //…code to handle YourException… } } void f() { try { //…something that might throw… } catch (…) { handleException(); } } 令我困扰的是单throw; 声明:如果你考虑给定的例子,那么很明显它是这样做的:它重新抛出f()第一个被捕获的exception并再次处理它。 但是如果我直接调用handleException()而不是从catch()子句中调用呢? 有没有指定的行为? 此外,对于奖励积分,还有其他“怪异”(可能不是好词)使用的throw ,你知道吗? […]

什么是抑制的exception?

一个关于tail call优化问题的回答 (由用户soc )提到,由于“增加了ARM”(支持ARM CPU?),Java 7有一个称为“抑制exception”的新function。 在这种情况下什么是“压制例外”? 在其他情况下,“被压制的例外”将是一个被抓住然后被忽视的例外(很less是一个好主意)。 这显然是不同的。

Clojure中的自定义exception?

我一直试图在Clojure中创build一个用户定义的exception,并且遇到各种各样的问题。 我尝试了这里概述的方法: http://en.wikibooks.org/wiki/Clojure_Programming/Concepts#User-Defined_Exceptions (gen-and-load-class 'user.MyException :extends Exception) 但是,这似乎并没有在Clojure 1.2(或我做错了什么…)。 我的环境是Clojure 1.2,Emacs和lein swank。 谢谢你的帮助!

使用NLogloggingexception时如何获取堆栈跟踪?

当我使用NLog的默认布局时,它只打印exception的名称。 我已经被告知log4jxmlevent布局不会打印任何exception。 什么布局会帮助我? 示例代码: try { throw new SystemException(); } catch (Exception ex) { logger.Error("oi", ex); } 默认布局输出: 2011-01-14 09:14:48.0343|ERROR|ConsoleApplication.Program|oi log4jxmlevent输出: <log4j:event logger="ConsoleApplication.Program" level="ERROR" timestamp="1295003776872" thread="9"> <log4j:message>oi</log4j:message> <log4j:NDC /> <log4j:locationInfo class="ConsoleApplication.Program" method="Void Main(System.String[])" file="C:\Users\User\Documents\Visual Studio 2010\Projects\ConsoleApplication\ConsoleApplication\Program.cs" line="21" /> <nlog:eventSequenceNumber>3</nlog:eventSequenceNumber> <nlog:locationInfo assembly="ConsoleApplication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> <log4j:properties> <log4j:data name="log4japp" value="true" /> <log4j:data name="log4jmachinename" value="MACHINE" /> </log4j:properties>

硬编码string“第三行”,应该使用@string资源

我是一个初学者的android开发者,我试图在eclipse中运行这个线性布局: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1"> <TextView android:text="red" android:gravity="center_horizontal" android:background="#aa0000" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1"/> <TextView android:text="green" android:gravity="center_horizontal" android:background="#00aa00" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1"/> <TextView android:text="blue" android:gravity="center_horizontal" android:background="#0000aa" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1"/> <TextView android:text="yellow" android:gravity="center_horizontal" android:background="#aaaa00" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1"/> </LinearLayout> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1"> <TextView android:text="row one" android:textSize="15pt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1"/> […]

exception通知Gem和Rails 3

我试图让这个启动和运行,但我看到“未初始化的常量ExceptionNotifier”,每当我启动我的服务器。 http://github.com/rails/exception_notification 在我的Gemfile中有 gem“exception_notification”,:git =>“ http://github.com/rails/exception_notification.git ”,:branch =>“master” 我已经尝试把config / application.rb,config / environment.rb和config.ru中的github自述文件中显示的configuration。 我用我的应用程序名称replace了“无论”。

检查内部exception的最佳方法是什么?

我知道有时innerException是null 所以以下可能会失败: repEvent.InnerException = ex.InnerException.Message; 有没有一个快速三元的方法来检查是否innerException是否为空?

android.mk arm-linux-androideabi-g ++exception和__cxa_allocate_exception

我正在从源重buildAndroid(现在使用模拟器闪存到设备上),尝试添加一个命令行工具。 我已经把我的来源回购/ exernal / …和书面Android.mk 。 我得到以下的定义: __cxa_allocate_exception __cxa_begin_catch __cxa_end_catch __cxa_end_cleanup __cxa_free_exception __cxa_get_exception_ptr __cxa_rethrow __cxa_throw __gxx_personality_v0 我已经通过相同的undefinessearch了其他问题,但似乎无法findAndroid的解决scheme。 最终的链接命令生成为: prebuilt/darwin-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-g++ -nostdlib -Bdynamic -Wl,-T,build/core/armelf.x -Wl,-dynamic-linker,/system/bin/linker -Wl,–gc-sections -Wl,-z,nocopyreloc -o out/target/product/generic/obj/EXECUTABLES/wavsender_intermediates/LINKED/wavsender -Lout/target/product/generic/obj/lib -Wl,-rpath-link=out/target/product/generic/obj/lib -lc -llog -lcutils -lnetutils -lc -lstdc++ -lm out/target/product/generic/obj/lib/crtbegin_dynamic.o out/target/product/generic/obj/EXECUTABLES/wavsender_intermediates/ohSongcast/WavSender/WavSender.o out/target/product/generic/obj/STATIC_LIBRARIES/liblog_intermediates/liblog.a out/target/product/generic/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a out/target/product/generic/obj/STATIC_LIBRARIES/libopenhome_intermediates/libopenhome.a out/target/product/generic/obj/STATIC_LIBRARIES/libgtest_intermediates/libgtest.a out/target/product/generic/obj/STATIC_LIBRARIES/libstlport_static_intermediates/libstlport_static.a out/target/product/generic/obj/STATIC_LIBRARIES/libstdc++_intermediates/libstdc++.a out/target/product/generic/obj/STATIC_LIBRARIES/libgabi++_intermediates/libgabi++.a -Wl,-z,noexecstack -Wl,–icf=safe -Wl,–fix-cortex-a8 prebuilt/darwin-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/armv7-a/libgcc.a out/target/product/generic/obj/lib/crtend_android.o Android.mk是: include $(CLEAR_VARS) LOCAL_MODULE := […]

是否有.Netexceptiontypes的列表,并在何时使用它们的build议?

有没有人知道.Netexceptiontypes列表。例如ArgumentNullException ,在什么情况下,你应该使用它们? 目前,我只是猜测types名称,但我宁愿得到它的权利。

使用macros或键盘快捷键切换“抛出exception时中断”

编辑:Visual Studio 2015的新的exception窗口比旧的对话快得多,我不再关心使用键盘快捷键。 是否有一个macros或键盘快捷方式,将切换“引发exception时中断”,而不使用GUI? 用ctrl + alt + e打开对话框并选中“Common Language Runtime Exceptions”“Thrown”框,然后点击OK就足够简单了,但这是我做的很多事情。 我宁愿有一个键盘快捷键。 这个问题是重复的任何有一个Visual Studio快捷方式/macros切换处理/未处理的exception中断? 然而,海报接受了一个并不真正起作用的答案,我真的很想有一个可行的答案。 重复问题中的答案是不可接受的,因为它只切换一个特定的exception,而不是整个CLR组。 “那就写一个循环吧。” 你说。 但不是那么快! 有人已经试过了 ,而且是无用的慢。 (是的,我已经validation了它在我的系统上也很慢。) 所以面临的挑战是使用macros在不到1或2秒的时间内切换整个CLRexception类别。 这个问题是重复的任何有一个Visual Studio快捷方式/macros切换处理/未处理的exception中断?