exception

VideoCapture: Capture Graph Error

随声附和 提交于 2019-12-24 10:18:19
问题 I use the Python (2.7) package VideoCapture. When I try to instantiate the Device, I get an Exception: Error: Capture Graph could not be created. I use cam = Device() , so nothing special there. I have one laptop where this works without a problem, and another where I get the Exception. They are different, but both have internal USB-Webcams. One week ago it worked, but now I only get the exception. Both use Windows 7. Does anybody have an idea how to resolve this, or how I could get more

Math.sqrt(-5) -> Force Exception in JSP?

空扰寡人 提交于 2019-12-24 09:51:07
问题 I've 3 .jsp files. index.jsp and sqrtcalculator.jsp and error.jsp. In index.jsp there's a text field and a button. In sqrtcalculator.jps there's the, well, calculator. Now, when I leave the field empty and press the button, an expection is called, because the field is empty. And I can then reroute to an individual error.jsp site to display the errors, and exception stack like <%= request.getAttribute("javax.servlet.error.request_uri") %> <%= exception.getMessage() %> <%= exception %> etc.

Does some event like Thread.OnAborting() exist?

折月煮酒 提交于 2019-12-24 09:49:34
问题 Environment: Let's say I have a main application that: Listen for requests for tasks to do, Perform those tasks (that use some resources (in a physical meaning)) one after another, Must be able to instantly stop a pending task to dispose the resources. I got two timers: On the timer1 tick, the application is retrieving new requests and store them in a Queue , On the timer2 tick, the application is dequeueing a request to perform the task in a new Thread . When a user ask to stop all tasks to

Change format timestamp exception Spring

拥有回忆 提交于 2019-12-24 09:47:58
问题 I'm using spring with @ResponseStatus to throw an exception like this: @ResponseStatus(value = HttpStatus.NOT_FOUND, reason = "Unknown task") public class TaskNotFoundException extends RuntimeException { private static final long serialVersionUID = 1L; private long taskId; public TaskNotFoundException(long taskId) { this.taskId = taskId; } public long getTaskId() { return taskId; } } I get this kind of response: { "timestamp": 1467278537988, "status": 404, "error": "Not Found", "exception":

How to simulate caught and logged exceptions inside a method and create JUnit tests

我只是一个虾纸丫 提交于 2019-12-24 09:17:11
问题 I have to write JUnit test cases for existing code where I do not have the liberty / opportunity to re-write the actual code. In many of these classes, the methods catch an exception internally and just log it. And the exceptions are not based on any parameters which could be manipulated to attempt to throw the exception, but are thrown by the code inside the method - e.g. - the method may open a file and catch IOException and just log it. Basically, many of the methods just eat all the

How to catch a MessagingException on Apache Axis

一曲冷凌霜 提交于 2019-12-24 09:13:36
问题 On my Axis 1.4 webservice this exception is thrown when an incoming message is corrupted. WARN ;2010-07-15 14:45:38,232;org.apache.axis.attachments.AttachmentsImpl;;Exception: AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: javax.mail.MessagingException: Error in input stream; nested exception is: java.io.IOException: End of stream encountered before final boundary marker. faultActor: faultNode: faultDetail: {http://xml.apache

Throw an exception in a function or how to do descent error handling [closed]

↘锁芯ラ 提交于 2019-12-24 09:09:21
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am currently using MySQLi prepared statements for my database handling. Because MySQLi prepared statements only throw an error when the connection is wrong, I am forced to check for errors myself and to throw them myself too. In PDO (which I am going to use in the future because I'm convinced now it works way

Why does JavaScript not throw an exception for this code sample?

耗尽温柔 提交于 2019-12-24 08:46:56
问题 I hope people will forgive me a fairly basic JavaScript question (it's not generally a "primary" language for me). I was looking at W3Schools's JavaScript tutorial for review; their lesson on arrays has the following warning and code sample: Warning: Adding elements with high indexes can create undefined "holes" in an array: var fruits = ["Banana", "Orange", "Apple", "Mango"]; fruits[6] = "Lemon"; // adds a new element (Lemon) to fruits This will result in indices 4 and 5 containing undefined

Tika 1.13 RuntimeException

孤人 提交于 2019-12-24 08:08:38
问题 I recently updated my existing tika project to use tika 1.13 instead of 1.10. The only thing I did was changing the dependency version from 1.10 to 1.13. The project was built successfully. Yet whenever I try and run the application I get this exception: java.lang.RuntimeException: Unable to parse the default media type registry at org.apache.tika.mime.MimeTypes.getDefaultMimeTypes(MimeTypes.java:580) at org.apache.tika.config.TikaConfig.getDefaultMimeTypes(TikaConfig.java:69) at org.apache

new[] / delete[] and throwing constructors / destructors in C++

眉间皱痕 提交于 2019-12-24 08:01:50
问题 What happens, in the following code, if construction / destruction of some array element throws? X* x = new X[10]; // (1) delete[] x; // (2) I know that memory leaks are prevented, but additionally: Ad (1), are the previously constructed elements destructed? If yes, what happens if destructor throws in such a case? Ad (2), are the not-yet-destructed elements destructed? If yes, what happens if destructor throws again? 回答1: Yes, if the constructor of x[5] throws, then the five array elements x