exception

Exception thrown while working with JTabbedPane

I'm using a JTabbedPane in my application and I listen to its changes with ChangeListener so that I can know which tab is currently selected. So my stateChanged method is; public void stateChanged(ChangeEvent e) { currentPageIndex = jTabbedPane.getSelectedIndex(); } But while I'm adding new tabs to the JTabbedPane it throws an Arr...

floating exception using icc compiler

I'm compiling my code via the following command: icc -ltbb test.cxx -o test Then when I run the program: time ./mp6 100 > output.modified Floating exception 4.871u 0.405s 0:05.28 99.8% 0+0k 0+0io 0pf+0w I get a "Floating exception". This following is code in C++ that I had before the exception and after: // before if (j < E[i]...

To get which function/line threw exception in javascript

I am trying to create a Exception class to get and send errors from client to server. I want to catch exception in javascript function and push the details to the web service to write to database. But i couldn't get how to get which function/line throwed this exception. Is there any way to solve this? ...

Unable to connect SQL Server instance from Visual Studio 2008 Version 9.0

I am getting the below error from VS on an 32-bit XP Professional server even though I set Tools->Options->Database Tools->Data Connections to "SIDEKICK", which is the name of my computer. In other words SIDEKICK should default to the full SQLSERVER. In other words, I want VS to use SQLSERVER instead of SQLSERVER EXPRESS. And I can ...

Good style for handling constructor failure of critical object

I'm trying to decide between two ways of instantiating an object & handling any constructor exceptions for an object that is critical to my program, i.e. if construction fails the program can't continue. I have a class SimpleMIDIOut that wraps basic Win32 MIDI functions. It will open a MIDI device in the constructor and close it in the...

Successive success checks

Most of you have probably bumped into a situation, where multiple things must be in check and in certain order before the application can proceed, for example in a very simple case of creating a listening socket (socket, bind, listen, accept etc.). There are at least two obvious ways (don't take this 100% verbatim): if (1st_ok) { if (...

Java: Is catching exceptions asynchronous?

I am asking because if it is not, it can be abused as synchronizations mechanism. I am asking about Java. ...

Timeout in LINQ to SQL inserting millions of records

I'm inserting approximently 3 million records in a database using this solution. Eventually when the application has been inserting records for a while (my last run lasted around 4 hours), it gives a timeout with the following SqlException: "SqlExcepetion: Timeout expired. The timeoutperiod elapsed prior to completion of the operatio...

Using javax.script, how can I get underlying Java Exceptions to survive through JavaScript?

We used to run rhino, but now with Java 6 we want to switch and use the built in JavaScript support. We are injecting Java objects into JavaScript and run methods on them. When something goes wrong -- Exceptions are thrown we want to handle those exceptions. We used to be able to get them by just getCause on the exception but that is no ...

Why is C++0x's `noexcept` checked dynamically?

I am curious about the rationale behind noexcept in the C++0x FCD. throw(X) was depreciated, but noexcept seems to do the same thing. Is there a reason that noexcept isn't checked at compile time? It seems that it would be better if these functions were checked statically that they only called throwing functions within a try block. ...

Exception error in Erlang

So I've been using Erlang for the last eight hours, and I've spent two of those banging my head against the keyboard trying to figure out the exception error my console keeps returning. I'm writing a dice program to learn erlang. I want it to be able to call from the console through the erlang interpreter. The program accepts a number o...

Likelihood of IOError during print vs. write

I recently encountered an IOError writing to a file on NFS. There wasn't a disk space or permission issue, so I assume this was just a network hiccup. The obvious solution is to wrap the write in a try-except, but I was curious whether the implementation of print and write in Python make either of the following more or less likely to rai...

How to handle sharepoint web services exceptions

Hi, I have developed an application of share point. I am using web services for that. the problem is that while working with my app sometimes i get some exceptions. like, Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown. Stack Strace :: at System.Web.Services.Protocols.SoapHttpClientPr...

Junit : add handling logic when exception is not expected

I am trying to print the stack trace of the exception. However, for negative test case, only the unexpected exception is printed. I am using the @Rule ExpectedException to do the exception detection. I don't know how to add handling logic in case an unexpected exception is thrown. @Rule public ExpectedException thrown = ExpectedEx...

Exception handling policy in libraries

When building a .NET library, what's your exception handling policy? In specific, what's your policy about handling exceptions inside library calls and exposing them to calling code? For example, Would you treat a library function as any other, thus letting all exceptions it can't handle flow out of it as-is? Would you create a custom...

Have you ever seen a Java File close() throw an exception?

Has anyone ever seen an exception thrown when calling close method on any closable object? ...

Trying to update an ASP.Net MVC 1.0 project to MVC 2.0

I'm trying to update my project to ASP.Net MVC 2.0 from MVC 1.0. I've removed the references for System.Web.MVC to the newer versions. I'm getting an exception from the HTTPContext which reads "CurrentNotification = 'HttpContext.Current.CurrentNotification' threw an exception of type 'System.PlatformNotSupportedException'". What other...

ProtectedData.Unprotect() fails with CryptographicException "The requested operation requires delegation to be enabled on the machine."

Calls to PortectedData.Unprotect on my development computer fail with a CryptographicException of "The requested operation requires delegation to be enabled on the machine.". The Unprotect method is being used to decrypt the initialization vector that is stored in the local registry. No other computers are used, so the Active Directory...

.NET framework execution aborted while executing CLR stored procedure?

I constructed a stored procedure that does the equivalent of FOR XML AUTO in SQL Server 2008. Now that I'm testing it, it gives me a really unhelpful error message. What does this error mean? Msg 10329, Level 16, State 49, Procedure ForXML, Line 0 .NET Framework execution was aborted. System.Threading.ThreadAbortException: Thread was...

Is there a functional version of begin...rescue...end (exception block) in ruby?

I'd like to do something like this in ruby: safe_variable = begin potentially_nil_variable.foo rescue some_other_safe_value end ... and treat the exception block (begin/rescue/end) as a function/block. This doesn't work as written, but is there a way to get a similar result? NB what I'm actually doing is this, which works but is ...