Intellij isn't breaking on uncaught exceptions - debugging

I'm getting a NullPointerException while writing Clojure in Intellij. When trying to debug it, Intellij is refusing to break when the exception happens.
Here's a screenshot that sums up the situation:
Note in the breakpoint manager on the left, I have a breakpoint set for NullPointerExceptions to fire when an uncaught exception happens. On the right, you can see that despite this breakpoint being set, a NPE is still managing to get through. I know from the rest of the message I seem to be trying to cast a null/nil to a double, but without a stack trace that's only so helpful.
If I check "Caught exception" it fires, but then I have to sift through a ton of NPE's that are happening internally that don't have anything to do with my problem. If I make it more general and ask it to break on any uncaught exception, it still refuses to break.
I don't think including code is necessary since I don't expect anyone to actually debug it for me; I'm more curious as to why it's not breaking when I expect it to.

Related

Nativescript error context is not fully stringified

It makes development really hard when you can't see stacktrace and the context of the error. Is there any way to make nativescript errors more transparent? How I can manage to stringify the error context?
JS: ERROR TypeError: format.replace is not a function
JS: ERROR CONTEXT [object Object]
It is really hard to search for that null variable. A needle in the haystack...
I found a workaround solution but still we should spend time to view the error context.
If you are using Angular with Nativescript probably your error is being thrown from core.umd.js (#Angular). Without Nativescript every field of the error is visible. I found two solutions that still take time:
Method 1: You can easily debug your error by placing a breakpoint to callWithDebugContext function.
Method 2: You can catch any throw on any level using try...catch, you may wrap your method and stringify your err.context.
I am not considering top most level try...catch as a solution.
But these are still not the best way. Nativescript team should fix this console logging issue.

Laravel 4.2 SuperClosure: Attempted to serialize unserializable builtin class Closure

History:
Laravel 4.2 recently updated from 4.1 running on HHVM-stable
This exact code worked before whatever broke broke
Downgrading back to 4.1 didn't resolve
Whenever (apparently) an uncaught exception is thrown, the app crashes with:
exception 'ErrorException' with message 'Attempted to serialize unserializable builtin class Closure$;1617701371#2$9f9bb1ee4ac7330c21e327d2b7294b9c$'
in /home/forge/.../vendor/jeremeamia/SuperClosure/src/Jeremeamia/SuperClosure/SerializableClosure.php:78
It's a dickens to troubleshoot because it seems to crash during error handling, so the feedback it gives me is less than helpful.
Any idea what this is about? Am I alone with this error? Googling turns up nada and this has pretty much shut us down until I can resolve it.
Turns out that happens if you try to serialize an Exception. (In this case, outputting it via Log::error("...", [$e]). Just stringify it and all is good.

Calling DisplayRequest.RequestRelease function in windows 8 app

I want to turn off the display at a particular point using DisplayRequest.RequestRelease but im getting various exception. When i tried for desktop im getting "Arithmetic result exceeded 32 bits" error. In phone im getting system.excecutionEngine exception. I need to know the correct usage of this function.
There are two things wrong here.
DisplayRequest.RequestRelease is used to release a previous request to keep the display alive. If you haven't called RequestActive before, then it won't work and will throw the exception.
If you are doing it to release a previous call, then it's possible that things are going wrong after a suspend operation, because you may have inadvertently called RequestRelease in your OnNavigatingFrom member. Please see my blog for full details at Most of my Windows 8 Apps are broken. Yours probably are too

How to watch for UNHANDLED exceptions only using WaitForDebugEvent family functions?

I'm trying to catch unhandled exceptions in the application and restart it on them using WaitForDebugEvent function. But I can't tell when exception is handled by application (try..catch for example) and when is not. How do I do that? There seem to be no such data in DEBUG_EVENT structure.
If your not catching certain exceptions using WaitForDebugEvent, you might want to try injecting an UnhandledExceptionFilter as well. other than that, check that your processing matches Microsofts Example
In the EXCEPTION_DEBUG_INFO structure, which is in the DEBUG_EVENT structure, there is a field dwFirstChance:
If the dwFirstChance member is nonzero, this is the first time the debugger has encountered the exception. Debuggers typically handle breakpoint and single-step exceptions when they are first encountered. If this member is zero, the debugger has previously encountered the exception. This occurs only if, during the search for structured exception handlers, either no handler was found or the exception was continued.
So you will want to look for times where dwFirstChance is 0.
But if you just want to restart your app when it fails, it might be easier to create another app to watch for the failure of the first one, rather than using the Windows debugging api.

DirectWebRemoting errors

I am supporting an application that has some DWR components. Whenever there is a server error i get a javascript alert that simply says 'error'.
Does anyone know where this might be configured and if there is a way to disable this. Id rather it silently fail at whatever then do this very distracting message.
Use DWR exception handlers in the positions wherever there is a chance for run time errors.
Use try catch mechanism and printstacktrace() in catch block. It works for me!

Resources