exception

.NET COMException Interface non registered

I can't understand this. I want to use an OCX from this vendor http://www.mobyt.it/ to send SMSs. It is a dll and they provide usage examples in Vb, .NET, Visual C, etc. The exception I get is: System.Runtime.InteropServices.COMException (0x80040154): Interface not registered. (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))...

php HttpRequests until the response is available with loading bar

Hello there! try { $r->send (); echo $r->getResponseBody(); } catch (HttpException $ex) { echo 'Message: ' .$ex->getMessage(); echo "<h5>No Resutls provided from blah blah for this domain name</h5> </div>"; } I use the HTTPRequest method to do requests to a server that I have im...

Pure exceptions in Haskell

How can exceptions be used in Haskell without going through IO? I have the following code for inserting an element in a binary search tree with minimum comparisons and no copying when the element is a member of the tree. I noticed that either is used as catch and Left as throw: insert x t = either (const t) id (insert' x t Nothing) ...

Uncatchable .NET runtime 2.0 error - user machine - what next?

Situation: I have an application that uses http connections extensively (stream ripping app) and it is supposed to work 24/7. And it does. However, occasionally, it crashes with runtime error that is uncaught anywhere, and dumps following to the event log: Event Type: Error Event Source: .NET Runtime 2.0 Error Reporting Event Categ...

WPF throws PInvokeStackImbalance when call mouse_event

Here is my code, as soon as I call mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, (long)0, (long)0); I recieve the PInvokeStackImbalance exception. Does someone knows why? [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] public static extern void mouse_event(long dwFlags, long dx, long dy...

continue my application when occur a exception

The codes: String[] logs={"a","b","c"}; int errors=0; for(String str:logs){ try{ LogParser.parse(str); } catch(ParseException e){ error++; continue; // Seems that, this two line codes are not reached. } } In the above codes, the LogParser used to parse the tomcat log of combined pattern,when get the date format data...

C# Exception Handling

I have class that predominately consists of gather string input and then subsequently outputting the data in a certain format. The result of the class is basically a ToString() override. With my class I have a static method string Print(string path) that reads the inputs from a flat file. It then parses these inputs and generates an i...

C# - Entity framework, duplicate unique exception?

Hello there, I'm trying to catch the exception throwen when I insert a already existing user with the given username into my database. As the title says then I'm using EF. The only exception thats throwen when I try to insert the user into to db is a "UpdateException" - How can I extract this exception to identify whether its a duplicate...

How to catch 500 internal server error in c#

Im using Google Analytics Dashboard Control which are available at http://gadashboardcontrols.codeplex.com/ Issue is its working fine when im connected to internet but if im using it on a machine that doesnt have internet access then it shows Server Error in '/' Application. The remote name could not be resolved: 'www.google.com' ...

Should I return null or throw an exception?

I found questions here http://stackoverflow.com/questions/175532/return-null-or-throw-exception and http://stackoverflow.com/questions/1626597/should-functions-return-null-or-an-empty-object, but I think my case is quite different. I'm writing an application that consists of a webservice and a client. The webservice is responsible to ac...

Android: UnknownHostException when sending HTTP POST

Hello, What I'd like to do is sending a HTTP POST request to a REST webservice. However it seems as if my applicaion cannot connect to the host. The application throws the following exception when sending the request: 10-19 18:54:05.335: VERBOSE/SD(280): java.net.UnknownHostException: http://www.myhost.com 10-19 18:54:05.335: VERBOSE/S...

Eating Exceptions

I m parsing a file that has MalFormed data from time to time. and it s throwing an exception, i d like to recover from the exception and ignore the bad formatted data. What s the best way to do this? try{ // parse file }catch(Exception){ //eat it. } *EDIT:*I think, my question wasnt understood well. i d like to recover from the exc...

TaskScheduler.UnobservedTaskException never gets called

Based on my research, I have learned the following: TaskScheduler.UnobservedTaskException must wait for the task to be garbage collected before that task's unobserved exception will bubble up to the UnobservedTaskException event. If you're using Task.Wait(), it'll never get called anyway, because you're blocking on an impending result ...

How is it possible for uri.Host to throw a UriFormatException?

foreach (var node in root.Find("a[href]")) { var href = node.Attributes["href"].Value; Uri uri; try { uri = new Uri(item.Value.Uri, href); } catch(UriFormatException) { continue; } // *snip* try { if (_imageHosts.IsMatch(uri.Host)) // <--- problematic line pr...

Application Crashes when loading the next view

Hi Everyone, I'm getting a strange crash time to time. But I can't figure out what it is. Can anyone help me?...Following is the console message that I'm getting... *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/mobile/Applications/36FA484A-7C...

FileNotFoundException in FileSystemWatcher

I am using a FileSystemWatcher on a directory and added its event handlers, set its EnableRaisingEvents to true and IncludeSubdirectories to false and added NotifyFilters. While running the application if I create new folders in the specified directory sometime I get FileNotFoundException : "An error occurred while reading a direct...

How to stop JBoss from spamming logs if an exception occurs in onMessage of a MDB?

I have a listener bean which calls on a session beans method in the MDBs onMessage method. If an exception occurs, such as IllegalStateException (which I throw) or NPE, then JBoss keeps logging the exception, and also keeps retrying to deliver the same message, again spamming the logs, then it sends the message to DLQ, and again calls on...

How do I store arbitrary binary data in a binary serialized class?

Using C#/.NET for my application, I've got a series of classes in my main data model that represent "binary" (as opposed to text) content. I've got a inheritance setup like this: Basically, the abstract class BinaryContent contains a MemoryStream that stores arbitrary binary data. That data is read from a file on disk. Each type of bi...

ASP.NET UnauthorizedAccessException

We have an intranet production server running in a virtual environment, which we cloned to make a development server. The computer name and IP are changed and everything is running fine. There is a shared folder on the production instance, which we reference from the development server because everything is readonly. I can visit the s...

WPF - error handling with asynchronous command using BackgroundWorker

I'm using the AsyncDelegateCommand class from this blog post but I'm having trouble knowing what to do with exceptions that occur in my action delegate. I create the following command: new AsyncDelegateCommand( readFile, // action to perform () => shouldReadFile, // can the action be executed? obj => readFileFinished(true),...