-
Shrewd Demon
c# exception handling
i know this could be a little weird but a doubt is a doubt afterall… what would happen in the following situation…private void SendMail() {try{//i try to send a mail and it throws an exception}catch(Exception ex){//so i will handle that exception over here//and since an exception occurred while sending a mail//i will log an event with the eventlog//All i want to know is what if an exception occurs here//while writing the error log, how should i handle it??} }Thank you.
-
AnthonyWJones
exception windows-phone-7 asynchronous handling
I’ve a JAVA based SOAP Web service which i am consuming in WP7 (Silverlight Client).I’m able to invoke it and retrieve the response back , but could not find any way to handle the server side SOAP exceptions arising out of scenarios like Web service offline , server down etc .I’ve put in Try Catch block too but it seems they are never reaching …exception goes out to References.cs file (proxy class file auto generated when Service is add referenced).After this application just crashes.I know al
-
fakemeta
c# winforms sqlite exception handling
I’ve been trying to add exception handling to my test app, but with no success. My app uses SQLite as database provider.I’m tring to catch SQLiteException:static void Main(){Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);try{Application.Run(new Main());}catch (System.Data.SQLite.SQLiteException){MessageBox.Show(“Unable to perform database operation. Database file is missing or corrupt”, “Database error”, MessageBoxButtons.OK, MessageBoxIcon.Error);}}In my M
-
Alexander Pravdin
javascript exception logging handling
If an unhandled exception occur in javascript code all browsers create beauty message in its log including exception type, message and stack trace and/or useful link to the source line. Now I want to catch an exception, put the same log as unhandled exception, and continue execution. I tried to write something liketry { … } catch (e) { console.log(e); }but all I got in Chrome is the exception type name in the log without any description and stack or source line link. How to create beautiful ex
-
Guilherme Cardoso
asp.net handling
I’m newbie when talks about Error Handling. It’s a subject that i want to study but right now i just don’t have free time, so i’m looking to implement an error/exception handler one a few projects i’ve developing last weeks (C#, .NET 3.5).What do you recommend me to implement for this? Other point is where to store the errors logs. In database or .xml file? Well, i really need some help on this!By the way, is there any book about error handling?Thanks in advanced, Guilherme Cardoso
-
user466898
c# handling asyncsocket
I have a 3 tier architecture and send some data in the transport layer (TCP Client) using tcp sockets is this methods asynchronously using BeginSend method.public void TransportData(Stream stream) {try{SetTransporterState(StateObject.State.SendingData);if (clientSock.Connected){ASCIIEncoding asen = new ASCIIEncoding();stream.Position = 0;byte[] ba = GetStreamAsByteArray(stream);if (clientSock.Connected)clientSock.BeginSend(ba, 0, ba.Length, SocketFlags.None, new AyncCallback(SendData), clientSoc
-
Roman
events blackberry touch handling
I try to implement simple touch event handling on Blackberry 9550 emulator, but it doesn’t work. Actually, touchEvent never gets called, ‘cos no text ever appears in the console. Also, I get an annoying “Full Menu” which appears on touching the screen. Here’s the code:package mypackage; import net.rim.device.api.system.Bitmap; import net.rim.device.api.system.EventInjector.TouchEvent; import net.rim.device.api.ui.Field; import net.rim.device.api.ui.Graphics; import net.rim.device.api.ui.VirtualK
-
Rich Sadowsky
flex actionscript-3 global handling
I’m trying to use the new(ish) AS3 global error handling class. I am trying to use it within a Flex mxml application. I can’t get it to work at all. Below is an entire program that shows the problem. I set this to use Flash Player 10.2 and compiled with the Flex 4.5 SDK.I’ve tried using Flex SDK 4.0 and 4.5 but I get the error in either case. I must be missing something obvious here. This is a normal Flex SWF file that will be shown on a web page. Assuming I could import the UncaughtErrorEvent,
-
Arti88
events openlayers handling mouseup onmouseup
Problem encountered while trying to get coords of a point where mouseUp event happens. Here is an event handler:$(‘#someDiv’) .on(“mouseup”, map, function(event) {click.trigger(event, map, d[i]); })And here is a trigger:OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {defaultHandlerOptions: {‘single’: true,’double’: false,’pixelTolerance’: 0,’stopSingle’: false,’stopDouble’: false},initialize: function(options) {this.handlerOptions = OpenLayers.Util.extend({}, this.defaultHandle
-
loungelizard
flash actionscript-3 global handling
Trying to implement the new FP 10.1 Global error handler into my projects but no matter what I do any uncaught error will still show up the Exception window (both in debug and release versions of the SWF). All I want to do is to prevent these popups but instead send a message to my logger. Here’s my code …EDIT: I simplified the code now. Could somebody do me a favor and test the following class and see if it’s works for him? Because it’s doesn’t for me! …package {import flash.display.Sprite;
-
Michal Klouda
jquery function handling
I’m working on the error handling for a jQuery practise project and I was wondering if it is possible to get the line were the error occured. For example:function number(x) {if (x === 1) {alert(“ok”);} else {alert(“Invalid number was given on line …”)} }number(2);?Now I would like to alert instead of the … the line the error occured in. Thanks in advance.
-
imacake
linux bash signals handling ctrl
On Linux/Unix there are signals. The CtrlC one (SIGINT) is obvious to me. Now, in some other applications there are signals via CtrlX?! Is that even a signal or does it generate an escape sequence? Is there anything else I can use as something similar to CtrlC ( CtrlV, CtrlX …)?If anyone has a clue, im familiar with C more than bash, but answers in both languages are appreciated!
-
Vee
c++ exception try-catch handling
I understand that try and catch() are used for exception handling, just in case an error or crash would occur in the program under certain cases. I also understand how they work. But why use try and catch()? Why not just use an if() statement that looks for a certain case and if that case is true, it does cout << //error code?
-
Nicholas Knight
python handling nameerror
I am writing a function which takes the user input:def func(input):I put in try and excepts to make sure the input is of the type I want. However, when I put in testInput, it throws a NameError vs “testInput”. I understand why as it is thinking testInput is a variable name while it knows “testInput” is a string.Is there an intelligent way to catch this error?
-
user1726395
java exception handling
For school I was creating a simple Geometry program asking for the number of corners and coordinates of a shape. To prevent wrongfull entry (ie chars instead of integers) I figured I’d use exception handling. It seems to work fine, but once I have a wrong input it catches the error and set some default values. It should continue asking for more input, but somehow these end-up catching the same exception without asking for new input.public static void main(String[] args) {Scanner stdin = new Scan