unhandled-exception

c++ stack trace from unhandled exception?

泄露秘密 提交于 2019-11-27 18:00:46
This question has been asked before and there have been windows-specific answers but no satisfactory gcc answer. I can use set_terminate() to set a function that will be called (in place of terminate() ) when an unhandled exception is thrown. I know how to use the backtrace library to generate a stack trace from a given point in the program. However, this won't help when my terminate-replacement is called since at that point the stack has been unwound. Yet if I simply allow the program to abort() , it will produce a core-dump which contains the full stack information from the point at which

Visual Studio 2015 break on unhandled exceptions not working

无人久伴 提交于 2019-11-27 17:28:37
Visual studio used to have a specific checkbox to "Break on Un-handled exception". In 2015 this has been removed (or moved somewhere I cannot find it). So now my converted projects no longer break if I fail to provide a user-level exception handler. I don't want to break on all "thrown exceptions" because I handle specific ones. Just where I fail to provide a specific handler. Right now my code simply exits the current procedure and continues execution at the next call stack location, NOT GOOD. Anyone know how to get this back in Visual Studio 2015? I just upgraded to the community edition

How do I get at the exception information when using MiniDumpWriteDump out-of-process?

自作多情 提交于 2019-11-27 13:48:42
When using the MiniDumpWriteDump function to create a core dump of a process on Windows, it is recommended (e.g. here , and here ) that the MiniDumpWriteDump is run from another "watchdog" process because it may well not work when called from within the same process. At the moment, our application is calling it in-process on an unhandled exception (we do it from a watchdog thread). Since we sometimes have problems with it not working, we'd like to move it to a separate process. Now, signalling the other process to start writing the dump is trivial (just use an event, semaphore, you name it)

How can I set up .NET UnhandledException handling in a Windows service?

岁酱吖の 提交于 2019-11-27 13:01:31
protected override void OnStart(string[] args) { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Thread.Sleep(10000); throw new Exception(); } void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { } I attached a debugger to the above code in my windows service, setting a breakpoint in CurrentDomain_UnhandledException, but it was never hit. The exception pops up saying that it is unhandled, and then the service stops. I even tried putting some code in the event handler, in case it was getting

catch another process unhandled exception

自闭症网瘾萝莉.ら 提交于 2019-11-27 08:04:17
I wish to know if i can catch the unhandled exceptions thrown by another process which I started using the Process.Start(...) I know i can catch the standered error using this link , but what I want is to catch the error that are usually caught by the Just In Time debugger of the.net environment, the window with the following words: "An unhandled exception has occurred in your application . If you Continue, the application will ignore this error and attempt to continue . If you click Quit, the application will be shut down immediately ...." Which is then followed by the exception message and a

The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception

不想你离开。 提交于 2019-11-27 07:08:05
问题 I'm working on a project and have run into an issue. When I run my code I get this error message: The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception The title of the message is "TypeInitializerException was unhandled". I receive this error at this line of code: this.crystalReportViewer = new CrystalDecisions.Windows.Forms.CrystalReportViewer(); I've been looking up ways to fix this issue, but I keep running into another issue. Everything I find about how to fix

Why is “throws Exception” necessary when calling a function?

橙三吉。 提交于 2019-11-27 05:53:47
class throwseg1 { void show() throws Exception { throw new Exception("my.own.Exception"); } void show2() throws Exception // Why throws is necessary here ? { show(); } void show3() throws Exception // Why throws is necessary here ? { show2(); } public static void main(String s[]) throws Exception // Why throws is necessary here ? { throwseg1 o1 = new throwseg1(); o1.show3(); } } Why compiler reports that methods show2() , show3() , and main() have unreported exception Exception that must be caught or declared to be thrown when I remove throws Exception from these methods? Jomoos In Java, as

unhandled exception type error

给你一囗甜甜゛ 提交于 2019-11-27 04:41:48
I have never gotten this error before so I am not sure what to do or what it means Unhandled exception type OperationApplicationException It occurs in this code: public void putSettings(SharedPreferences pref){ ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>(); ops.add(ContentProviderOperation.newUpdate(Data.CONTENT_URI) .withSelection(Data.RAW_CONTACT_ID + "=?", new String[]{String.valueOf(pref.getString(SmsPrefs.ID, ""))}) .withValue(Data.MIMETYPE,"vnd.android.cursor.item/color") .withValue("data1",nColor).build()); getContentResolver().applyBatch

Catch unhandled exceptions from async

青春壹個敷衍的年華 提交于 2019-11-27 01:33:52
问题 When an async method that is awaited upon throws an exception, the exception is stored somewhere and throwing it is delayed. In a WinForms or WPF application, it uses SynchronizationContext.Current to post throwing of the exception. However, in e.g. a console application, it throws the exception on a thread pool and it brings down the application. How can I prevent exceptions thrown from an async method from bringing down the application? EDIT: Appearantly the issue I'm describing is because

Java 8: How do I work with exception throwing methods in streams?

橙三吉。 提交于 2019-11-26 22:03:01
Suppose I have a class and a method class A { void foo() throws Exception() { ... } } Now I would like to call foo for each instance of A delivered by a stream like: void bar() throws Exception { Stream<A> as = ... as.forEach(a -> a.foo()); } Question: How do I properly handle the exception? The code does not compile on my machine because I do not handle the possible exceptions that can be thrown by foo(). The throws Exception of bar seems to be useless here. Why is that? You need to wrap your method call into another one, where you do not throw checked exceptions . You can still throw