Search Results

Search found 5259 results on 211 pages for 'interrupt handling'.

Page 3/211 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Defensive Error Handling

    TRY…CATCH error handling in SQL Server has certain limitations and inconsistencies that will trap the unwary developer, used to the more feature-rich error handling of client-side languages such as C# and Java. In this article, abstracted from his excellent new book, Defensive Database Programming with SQL Server, Alex Kuznetsov offers a simple, robust approach to checking and handling errors in SQL Server, with client-side error handling used to enforce what is done on the server.

    Read the article

  • Delphi Exception handling problem with multiple Exception handling blocks

    - by Robert Oschler
    I'm using Delphi Pro 6 on Windows XP with FastMM 4.92 and the JEDI JVCL 3.0. Given the code below, I'm having the following problem: only the first exception handling block gets a valid instance of E. The other blocks match properly with the class of the Exception being raised, but E is unassigned (nil). For example, given the current order of the exception handling blocks when I raise an E1 the block for E1 matches and E is a valid object instance. However, if I try to raise an E2, that block does match, but E is unassigned (nil). If I move the E2 catching block to the top of the ordering and raise an E1, then when the E1 block matches E is is now unassigned. With this new ordering if I raise an E2, E is properly assigned when it wasn't when the E2 block was not the first block in the ordering. Note I tried this case with a bare-bones project consisting of just a single Delphi form. Am I doing something really silly here or is something really wrong? Thanks, Robert type E1 = class(EAbort) end; E2 = class(EAbort) end; procedure TForm1.Button1Click(Sender: TObject); begin try raise E1.Create('hello'); except On E: E1 do begin OutputDebugString('E1'); end; On E: E2 do begin OutputDebugString('E2'); end; On E: Exception do begin OutputDebugString('E(all)'); end; end; // try() end;

    Read the article

  • Delph Exception handling problem with multiple Exception handling blocks

    - by Robert Oschler
    I'm using Delphi Pro 6 on Windows XP with FastMM 4.92 and the JEDI JVCL 3.0. Given the code below, I'm having the following problem: only the first exception handling block gets a valid instance of E. The other blocks match properly with the class of the Exception being raised, but E is unassigned (nil). For example, given the current order of the exception handling blocks when I raise an E1 the block for E1 matches and E is a valid object instance. However, if I try to raise an E2, that block does match, but E is unassigned (nil). If I move the E2 catching block to the top of the ordering and raise an E1, then when the E1 block matches E is is now unassigned. With this new ordering if I raise an E2, E is properly assigned when it wasn't when the E2 block was not the first block in the ordering. Note I tried this case with a bare-bones project consisting of just a single Delphi form. Am I doing something really silly here or is something really wrong? Thanks, Robert type E1 = class(EAbort) end; E2 = class(EAbort) end; procedure TForm1.Button1Click(Sender: TObject); begin try raise E1.Create('hello'); except On E: E1 do begin OutputDebugString('E1'); end; On E: E2 do begin OutputDebugString('E2'); end; On E: Exception do begin OutputDebugString('E(all)'); end; end; // try() end;

    Read the article

  • Design Pattern for error handling in ASP.NET 3.5 site

    - by Kevin
    I am relatively new to ASP.NET programming, and web programming in general. We have a site we recently ported from .NET 1.1 to 3.5. Currently we have two methods of error handling: either catching the error during data load on a page and displaying the formatted error in a label on the page, or redirecting to a generic error page. Both of these are somewhat annoying, as right now I'm trying to redesign how our errors are displayed. We are soon moving to Master pages, and I'm wondering if there is a way to "build in" an error handling control. What I mean by this is using a ASP.NET user control I've designed that simply gets passed the error string returned from the server. If an error occurs, the page would not display the content, and instead display the error control. This provides us with the ability to retain the current banner/navigation during an error (which we don't get with the generic error page), as well as keeping me from having to add the control to every aspx page we have (which I have to do with using the label-per-page system). Does something like this make sense? Ultimately I just want to have the error control added to a single page, and all other pages have access to it directly. Is this something Master pages help with? Thanks!

    Read the article

  • Centralized Exception handling for Eclipse plug-in

    - by Svilen
    Hello, At first I thought this would be question often asked, however trying (and failing) to look up info on this proved me wrong. Is there a mechanism in Eclipse platform for centralized exception handling of exceptions? For example... You have plug-in project which connects to a DB and issues queries, results of which are used to populate some e.g. views. This is like the most common example ever. :) Queries are executed almost for any user action, from every UI control the plug-in provides. Most likely the DB Query API will have some specific to the DB SomeDBGeneralException declared as being thrown by it. That's OK, you can handle those according to whatever your software design is. But how about unchecked exceptions which are likely to occur, e.g. , when communication with DB suddenly breaks for some network related reason? What if in such case one would like to catch those exceptions in a central place and for example provide user friendly message to the user (rather than the low level communication protocol api messages) and even some possible actions the user could execute in order to deal with the specific problem? Thinking in Eclipse platform context, the question may be rephrased as "Is there an extension point like "org.eclipse.ExceptionHandler" which allows to declare exception handlers for specific (some kind of filtering support) exceptions giving a lot of flexibility with the actual handling?"

    Read the article

  • Using callback functions for error handling in C

    - by Earlz
    Hi, I have been thinking about the difficulty incurred with C error handling.. like who actually does if(printf("hello world")==-1){exit(1);} But you break common standards by not doing such verbose, and usually useless coding. Well what if you had a wrapper around the libc? like so you could do something like.. //main... error_catchall(my_errors); printf("hello world"); //this will automatically call my_errors on an error of printf ignore=1; //this makes it so the function will return like normal and we can check error values ourself if(fopen.... //we want to know if the file opened or not and handle it ourself. } int my_errors(){ if(ignore==0){ _exit(1); //exit if we aren't handling this error by flagging ignore } return 0; //this is called when there is an error anywhere in the libc } ... I am considering making such a wrapper as I am synthesizing my own BSD licensed libc(so I already have to touch the untouchable..), but I would like to know what people think about it.. would this actually work in real life and be more useful than returning -1?

    Read the article

  • php: autoload exception handling.

    - by YuriKolovsky
    Hello again, I'm extending my previous question (Handling exceptions within exception handle) to address my bad coding practice. I'm trying to delegate autoload errors to a exception handler. <?php function __autoload($class_name) { $file = $class_name.'.php'; try { if (file_exists($file)) { include $file; }else{ throw new loadException("File $file is missing"); } if(!class_exists($class_name,false)){ throw new loadException("Class $class_name missing in $file"); } }catch(loadException $e){ header("HTTP/1.0 500 Internal Server Error"); $e->loadErrorPage('500'); exit; } return true; } class loadException extends Exception { public function __toString() { return get_class($this) . " in {$this->file}({$this->line})".PHP_EOL ."'{$this->message}'".PHP_EOL . "{$this->getTraceAsString()}"; } public function loadErrorPage($code){ try { $page = new pageClass(); echo $page->showPage($code); }catch(Exception $e){ echo 'fatal error: ', $code; } } } $test = new testClass(); ?> the above script is supposed to load a 404 page if the testClass.php file is missing, and it works fine, UNLESS the pageClass.php file is missing as well, in which case I see a "Fatal error: Class 'pageClass' not found in D:\xampp\htdocs\Test\PHP\errorhandle\index.php on line 29" instead of the "fatal error: 500" message I do not want to add a try/catch block to each and every class autoload (object creation), so i tried this. What is the proper way of handling this?

    Read the article

  • [C#] how to do Exception Handling & Tracing

    - by shrimpy
    Hi all, i am reading some C# books, and got some exercise don't know how to do, or not sure what does the question mean. Problem: After working for a company for some time, your skills as a knowledgeable developer are recognized, and you are given the task of “policing” the implementation of exception handling and tracing in the source code (C#) for an enterprise application that is under constant incremental development. The two goals set by the product architect are: 100% of methods in the entire application must have at least a standard exception handler, using try/catch/finally blocks; more complex methods must also have additional exception handling for specific exceptions All control flow code can optionally write “tracing” information to assist in debugging and instrumentation of the application at run-time in situations where traditional debuggers are not available (eg. on staging and production servers). (i am not quite understand these criterias, i came from the java world, java has two kind of exception, check and unchecked exception. Developer must handle checked exception, and do logging. about unchecked exception, still do logging maybe, but most of the time we just throw it. however here comes to C#, what should i do????) Question for Problem: List rules you would create for the development team to follow, and the ways in which you would enforce rules, to achieve these goals. How would you go about ensuring that all existing code complies with the rules specified by the product architect; in particular, what considerations would impact your planning for the work to ensure all existing code complies?

    Read the article

  • error handling with NSURLConnection sendSynchronousRequest

    - by Nnp
    how can i do better error handling with NSURLConnection sendSynchronousRequest? is there any way i can implement - (void)connection:(NSURLConnection *)aConn didFailWithError:(NSError *)error i have a nsoperation queue which is getting data in background thats why i have sync request. and if i have to implement async request then how can i wait for request to get complete. because that method can't proceed without data.

    Read the article

  • Spring MVC Best Practice Handling Unrecoverable Exceptions In Controller

    - by jboyd
    When you have a controller that does logic with services and DAO's that may throw an unrecoverable exception, what is the best practice in dealing with those method calls? Currently an app I'm working on has very lengthy try catch methods that simply err.out exception messages, this doesn't seem very robust and I think that this code smells, is there any cookie cutter best practice for handling this in spring-mvc?

    Read the article

  • C# Event handling In mutiple level /classes

    - by Amitd
    Hi, I have 3 classes A,B,C . Class A creates B .. class B creates class C. Class C raises events after some action/operation with some data, which is handled by event handler in Class B. Now I want to be handle or pass the same raised event data to Class A. I know i can raise another event from class B and handle it in A but is there a better way of handling such events?? Thx

    Read the article

  • VBA error handling and MZ-tools

    - by dmr
    Thanks to reading about error handling on StackOverflow, I discovered Mz-Tools. However, I am wondering if there is a way to simultaneously update all the error handlers added by MZ-Tools. If I add an error handler with MZ-Tools and then change the default error handler (via Options|Error Handler on the Mz-Tools toolbar), is there any way to have the changes automatically incorporated?

    Read the article

  • Prolog: Error Handling and Find Unique

    - by anotherstat
    Given: fruitid('Apple', 'Granny Smith', 1). fruitid('Apple', 'Cox', 2). fruitid('Pear', 'Bartlett', 3). How would I go about finding only unique items for instance: is_unique(FruitName):- In the example clauses the answer would be Pear. I'm also trying to add error handling to my code, so in this instance if an input is: is_unique(pineapple) How could I catch this and output an error message? Thanks, AS

    Read the article

  • ASP MVC - Getting Controller Level error handling

    - by RP
    How to get Controller-Level error handling: This is my map-route: routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); And I have 2 controllers - HomeController and AwayController I want both both controllers to handle their own errors For example, a call to /Home/InvalidAction would be handled by one method and /Away/InvalidAction would be handled by another method Where InvalidAction currently results in a 404 as there's no Action method with that name

    Read the article

  • Jquery error handling options

    - by yogsma
    I want to throw an error message if user doesn't input any value for a particular field. I am using blur event. I don't want to use ALERT function for throwing error messages. What are the other options we have available in jquery for error handling?

    Read the article

  • Exception handling protocol for methods

    - by athena
    Is there any specific protocol for handling exceptions in public methods? Consider this eg. public int someMethod() { try{ code that might throw an exception } catch(Exception e) { log the exception } } Say that this method might throw an ArrayIndexOutOfBoundsException. So, is it correct to handle this Exception in the method itself (as in the example) or throw it and assume that the calling method will handle the Exception?

    Read the article

  • Basic GUI Event Handling Questions C#

    - by JHarley1
    Good Afternoon, I have some very basic questions on GUI Event Handling. Firstly with C# how can we link events to objects - I am guessing event handlers? If so can each handler use separate code? - How can the event handler locate the objects it must manipulate? I have a rough idea of how it works in JAVA. Pointing me towards a reference would be fine - I have already trawled Google for answers to no avail. Many Thanks, J

    Read the article

  • Global Error Handling for Web Services

    - by jusaskin
    I have a web project consisting of only web services. I need a global way of handling errors on the server so I can send emails, log in event log, etc. Global.asax doesn't work according to MSDN. How should I go about this? I have tried creating a soapExtension, but it is never hit.

    Read the article

  • PHP error handling : my code is not optimized

    - by Tristan
    Hello, I must warn you, this code will heart your eyes, so please don't judge me, i'm trying to improve the way I handle errors all my tests are like this : if ($something < 27) { $error_IP= '<div class="error_message">something bad</div> '; }else{ $erreur_IP=''; } and here's the ugliest thing : if( !isset($_POST) || ($erreur_captcha !='') || ($erreur_email !='') || ($erreur_hebergeurVide != '') || ($erreur_paysVide != '') || ($erreur_slotVide != '') || ($erreur_rconVide != '') || ($erreur_tick != '') + a lot more :d ) What do you suggest to me to optimize my errors handling ? Thank you

    Read the article

  • event handling in C++

    - by Max
    Hi. I'm writing a game in C++, and I'm trying to get it to recognize keyboard and mouse events. Google tells me that boost.signal is suitable for event handling, but none of the code samples or tutorials I've found tell me how to associate a keypress or mouseclick with a function. Can anyone shed any light on this?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >