exception

Grails error handler always receives null pointer

让人想犯罪 __ 提交于 2019-12-23 17:40:24
问题 We have a custom error controller that gets called after all of our errors. However, most of our errors that get thrown end up coming into the controller as null pointers, even though the original error was not a null pointer. Any ideas? Code below. Bootstrap and UrlMappings available if needed. Thanks Error Handler method def HandleErrors = { def exception = request.exception.cause.class if (exception) { Exception ex = request.exception //This exception is always a NPE ... Block of code

How do you stop spring swallowing exceptions?

我与影子孤独终老i 提交于 2019-12-23 17:23:25
问题 When something fails on the server side because the database and the application are out of sync instead of getting an error and the application crashing spring/tomcat seems to swallow the exception and pretend nothing has happened. Call me crazy but if the program fails catastrophically I want it to actually fail catastrophically! Is there anyway to switch this behaviour off? It's really slowing development down when the server pretends that everything is fine when it's just thrown up into

Python: can't see exception that is getting thrown

最后都变了- 提交于 2019-12-23 17:21:43
问题 I am running a unit test and I realize that there is an exception getting thrown. However, I am just not sure what exactly is getting thrown. from pt_hil.utilities.PT_HIL_Interface_Utils.widgets import PathPicker import unittest import wx class TestUM(unittest.TestCase): @classmethod def setUpClass(cls): print 'setUpClass called' cls.path_picker = PathPicker() print 'path_picker has been declared' def test_PathPicker(self): self.assertRaises(NotImplementedError, wx.UIActionSimulator

What does lub(T1,… Tn) mean?

自作多情 提交于 2019-12-23 17:06:13
问题 The following quote is from JLS 14.20 The declared type of an exception parameter that denotes its type as a union with alternatives D1 | D2 | ... | Dn is lub(D1, D2, ..., Dn) . What is the lub(D1,...Dn) here? 回答1: It stands for "Least Upper Bound" and is formally defined in §4.10.4. Least Upper Bound: The least upper bound, or "lub", of a set of reference types is a shared supertype that is more specific than any other shared supertype (that is, no other shared supertype is a subtype of the

Is there any way to handle Java heap space exception [duplicate]

£可爱£侵袭症+ 提交于 2019-12-23 16:50:36
问题 This question already has answers here : How to deal with “java.lang.OutOfMemoryError: Java heap space” error? (19 answers) What is an OutOfMemoryError and how do I debug and fix it (4 answers) Closed 4 years ago . I am looking to convert file input stream for big file (The file is of 100MB) and it is throwing and java.lang.OutOfMemoryError : Java Heap space import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.io.IOUtils; public class TestClass { public static

Haskell exceptions and unit testing

帅比萌擦擦* 提交于 2019-12-23 16:41:11
问题 Based on SO question 13350164 How do I test for an error in Haskell?, I'm trying to write a unit test which asserts that given invalid input, a recursive function raises an exception. The approach I adopted works well for non-recursive functions (or when the first call raises the exception), but as soon as the exception occurs deeper in the call chain, the assertion fails. I've read the excellent answers to question 6537766 Haskell approaches to error handling but unfortunately the advice is

Is it possible to manually check LocateRegistry existing?

自作多情 提交于 2019-12-23 16:32:37
问题 I have found a safe way to get LocateRegistry (even if the registry does not already exist). Registry registry = null; try { registry = LocateRegistry.getRegistry(52365); registry.list(); // This call will throw an exception if the registry does not already exist } catch (RemoteException e) { registry = LocateRegistry.createRegistry(52365); } Is it possible to firstly check registry existence and use getRegistry or createRegistry in accordance with the result of the check? 回答1: Is it possible

Swift_RfcComplianceException on valid email address, works in Windows not in Ubuntu

自古美人都是妖i 提交于 2019-12-23 16:31:02
问题 I'm running into what appears to be a rather infamous issue with SwiftMailer: Fatal error: Uncaught exception ‘Swift_RfcComplianceException’ with message ‘Address in mailbox given [noreply@host.com] does not comply with RFC 2822, 3.6.2.’ The message is being created with the following code (effectively): $message = \Swift_Message::newInstance() ->setSubject('Subject') ->setFrom(array('noreply@host.com' => 'Host')) ->setTo('recipient@gmail.com'); ... The odd thing is that the address: noreply

Should this Perl 6 CATCH block be able to change variables in the lexical scope?

白昼怎懂夜的黑 提交于 2019-12-23 16:26:37
问题 I'm playing with resumable exceptions. In this example, I try to numify something that doesn't numify. I catch that and attempt to give the $value variable an appropirate value then resume execution: try { my $m = 'Hello'; my $value; $value = +$m; put "Outside value is 「{$value.^name}」"; CATCH { when X::Str::Numeric { put "「$m」 isn't a number!"; put "Inside value is 「{$value.^name}」"; $value = 0; put "Inside value is now 「$value.」"; .resume; } default { put "Unhandled type 「{.^name}」"; } }

C#, MAF, Unhandled Exception Management in separate AppDomain

两盒软妹~` 提交于 2019-12-23 16:25:22
问题 Okay, so I have a MAF application which loads up each addin inside of a separate appdomain. This is working fantastic for what I need as it allows me to dynamically unload and reload my addins at runtime. The problem is, I need to be able to take an unhandled exception in the child appdomain, catch it, and then let that appdomain fail gracefully without taking down the parent appdomain How do I go about doing this? It seems like a trivial task and one of the main benefits of using isolated