Search Results

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

Page 56/211 | < Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >

  • Zend Framework Module Based Error Handling

    - by cnkt
    Zend_Controller_Plugin_ErrorHandler always forwards to ErrorController::errorAction() in the default module but i want it be module aware. For example when a exception throws it must be call the module's ErrorController like Admin_ErrorController:errorAction. How can i do this? Thanks.

    Read the article

  • Method with throws Exception: Where is it actually handled?

    - by Esq
    Here is an example code, I am throwing an exception here, it works perfectly fine without the try/catch block of code for some reason. Do I have to handle this inside this method "EntryDelete" or Do I have to handle this where the method is called from? If so can I see an example, what do I have to import in there? What is the acceptable syntax or method to do this? public boolean EntryDelete(int entryId) throws SQLException{ this.open(); kDatabase.delete(kENTRY_TABLE, kENTRY_ENTRY_ID + "=" + entryId, null); this.close(); return true; } Thanks

    Read the article

  • How to change FPU context in signal handler (C++/Linux)

    - by Henry Fané
    I wrote a signal handler to catch FPE errors. I need to continue execution even if this happens. I receive a ucontext_t as parameter, I can change the bad operand from 0 to another value but the FPU context is still bad and I run into an infinite loop ? Does someone already manupulate the ucontext_t structure on Linux ? I finally found a way to handle these situations by clearing the status flag of ucontext_t like this: ... const long int cFPUStatusFlag = 0x3F; aContext->uc_mcontext.fpregs->sw &= ~cFPUStatusFlag; ... 0x3F is negated to put 0 in the 6 bits of the status register of the FPU (x87). Doing this implies to check for FPE exceptions after calculation.

    Read the article

  • Replacing objects, handling clones, dealing with write logs

    - by Alix
    Hi everyone, I'm dealing with a problem I can't figure out how to solve, and I'd love to hear some suggestions. [NOTE: I realise I'm asking several questions; however, answers need to take into account all of the issues, so I cannot split this into several questions] Here's the deal: I'm implementing a system that underlies user applications and that protect shared objects from concurrent accesses. The application programmer (whose application will run on top of my system) defines such shared objects like this: public class MyAtomicObject { // These are just examples of fields you may want to have in your class. public virtual int x { get; set; } public virtual List<int> list { get; set; } public virtual MyClassA objA { get; set; } public virtual MyClassB objB { get; set; } } As you can see they declare the fields of their class as auto-generated properties (auto-generated means they don't need to implement get and set). This is so that I can go in and extend their class and implement each get and set myself in order to handle possible concurrent accesses, etc. This is all well and good, but now it starts to get ugly: the application threads run transactions, like this: The thread signals it's starting a transaction. This means we now need to monitor its accesses to the fields of the atomic objects. The thread runs its code, possibly accessing fields for reading or writing. If there are accesses for writing, we'll hide them from the other transactions (other threads), and only make them visible in step 3. This is because the transaction may fail and have to roll back (undo) its updates, and in that case we don't want other threads to see its "dirty" data. The thread signals it wants to commit the transaction. If the commit is successful, the updates it made will now become visible to everyone else. Otherwise, the transaction will abort, the updates will remain invisible, and no one will ever know the transaction was there. So basically the concept of transaction is a series of accesses that appear to have happened atomically, that is, all at the same time, in the same instant, which would be the moment of successful commit. (This is as opposed to its updates becoming visible as it makes them) In order to hide the write accesses in step 2, I clone the accessed field (let's say it's the field list) and put it in the transaction's write log. After that, any time the transaction accesses list, it will actually be accessing the clone in its write log, and not the global copy everyone else sees. Like this, any changes it makes will be done to the (invisible) clone, not to the global copy. If in step 3 the commit is successful, the transaction should replace the global copy with the updated list it has in its write log, and then the changes become visible for everyone else at once. It would be something like this: myAtomicObject.list = updatedCloneOfListInTheWriteLog; Problem #1: possible references to the list. Let's say someone puts a reference to the global list in a dictionary. When I do... myAtomicObject.list = updatedCloneOfListInTheWriteLog; ...I'm just replacing the reference in the field list, but not the real object (I'm not overwriting the data), so in the dictionary we'll still have a reference to the old version of the list. A possible solution would be to overwrite the data (in the case of a list, empty the global list and add all the elements of the clone). More generically, I would need to copy the fields of one list to the other. I can do this with reflection, but that's not very pretty. Is there any other way to do it? Problem #2: even if problem #1 is solved, I still have a similar problem with the clone: the application programmer doesn't know I'm giving him a clone and not the global copy. What if he puts the clone in a dictionary? Then at commit there will be some references to the global copy and some to the clone, when in truth they should all point to the same object. I thought about providing a wrapper object that contains both the cloned list and a pointer to the global copy, but the programmer doesn't know about this wrapper, so they're not going to use the pointer at all. The wrapper would be like this: public class Wrapper<T> : T { // This would be the pointer to the global copy. The local data is contained in whatever fields the wrapper inherits from T. private T thisPtr; } I do need this wrapper for comparisons: if I have a dictionary that has an entry with the global copy as key, if I look it up with the clone, like this: dictionary[updatedCloneOfListInTheWriteLog] I need it to return the entry, that is, to think that updatedCloneOfListInTheWriteLog and the global copy are the same thing. For this, I can just override Equals, GetHashCode, operator== and operator!=, no problem. However I still don't know how to solve the case in which the programmer unknowingly inserts a reference to the clone in a dictionary. Problem #3: the wrapper must extend the class of the object it wraps (if it's wrapping MyClassA, it must extend MyClassA) so that it's accepted wherever an object of that class (MyClass) would be accepted. However, that class (MyClassA) may be final. This is pretty horrible :$. Any suggestions? I don't need to use a wrapper, anything you can think of is fine. What I cannot change is the write log (I need to have a write log) and the fact that the programmer doesn't know about the clone. I hope I've made some sense. Feel free to ask for more info if something needs some clearing up. Thanks so much!

    Read the article

  • Handling of data truncation in FUSE

    - by Vi
    I expect any good program should do all their reads and writes in a loop until all data written/read without relying that write will write everything (even with regular files). Am I right? Implemented simple FUSE filesystem which only allows reading and writing with small buffers, very often returning that it is written less bytes that in a buffer (using -o direct_io). Some programs work, some not. Are them buggy or programs should not expect truncated writes and reads from the regular files?

    Read the article

  • Check for live Data Source Name Before proceeding

    - by n_kips
    Would it be ok to get a CF app to check for a valid database before proceeding to process that request? This is because there may be instances where the database server may be down or being upgraded, hence an error comes when a db dependant request is made. If there is no connection to the db server, the user can be safely redirected to a safe page. Or can cfcatch work? How can this check be done? Thank you.

    Read the article

  • Magento: Why do controller action predispatch events not fire if the controller is rewritten?

    - by mattalexx
    Why do controller action predispatch events not fire if the controller is rewritten? Here is a snippet of store/app/code/core/Mage/Core/Controller/Varien/Action.php: abstract class Mage_Core_Controller_Varien_Action { // [...] public function preDispatch() { // [...] if ($this->_rewrite()) { return; // [What is the purpose if this?] } // [...] // [This is where my event needs to be firing, but this code never gets // executed because the controller is rewritten] Mage::dispatchEvent( 'controller_action_predispatch_'.$this->getFullActionName(), array('controller_action'=>$this) ); } // [...] } I don't know where to start fixing this problem. Anyone out there ever dealt with this before?

    Read the article

  • ExceptionHandling with Spring 3

    - by mjf
    I have this controller: @RequestMapping(value = "*.xls", method = RequestMethod.GET) public String excel(Model model) { return "excel"; The excel wiew opens actually a ExcelViewer, which is build in method protected void buildExcelDocument(Map<String, Object> map, WritableWorkbook ww, HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception { Class.writecontent Class.writeMoreContent Called methods write content to the Excel sheet and they can throw e.g biffException. How can I show a certain error page when Exception is occured? I tried this @Controller public class ExcelController { @ExceptionHandler(BiffException.class) public String handleException(BiffException ex) { return "fail"; } @RequestMapping(value = "*.xls", method = RequestMethod.GET) public String excel(Model model) { return "excel"; } } But I'm getting the server's error message about Exceptions. Maybe a bean definition missing?

    Read the article

  • How can I test Windows Error Reporting?

    - by Deneb Meketa
    My company participates in Windows Error Reporting via Winqual. We'd like to add some additional data to our crash reports, using WERRegisterMemoryBlock. Obviously we'd like to make sure this is working before we ship our next version. How can we test it? Is there a way to locally preview precisely what is going to be sent? Does this realistically reproduce what we are going to be able to retrieve from Winqual? Alternatively, can we generate a real report from a developer machine, then retrieve the report from Winqual? How would we distinguish this test case from the rest of our Winqual data?

    Read the article

  • Writing exceptions in multihreaded windows service to event log

    - by Ziplin
    I have a multithreaded windows service that will unpredictably stop running once every 24 hours or so. I am writing to the event log and that's going through just fine, but whenever the service crashes there are no messages in the event log (even that the service stopped, despite having AutoLog=true). Is there a way to have uncaught exceptions written straight to the log, even if they aren't in the original thread?

    Read the article

  • Does SQL Server 2005 error message numbers back to the asp.net application?

    - by Duke
    I'd like to get the message number and severity level information from SQL Server upon execution of an erroneous query. For example, when a user attempts to delete a row being referenced by another record, and the cascade relationship is "no action", I'd like the application to be able to check for error message 547 ("The DELETE statement conflicted with the REFERENCE constraint...") and return a user friendly and localized message to the user. When running such a query directly on SQL Server, the following message is printed: Msg 547, Level 16, State 0, Line 1 <Error message...> In an Asp.Net app is this information available in an event handler parameter or elsewhere? Also, I don't suppose anyone knows where I can find a definitive reference of SQL Server message numbers?

    Read the article

  • Is it ever OK to throw a java.lang.Error?

    - by Abhijeet Kashnia
    I have a plugin module that goes into a web application. If the module does not load correctly, it does not make sense for the web application to go on, and the web application should probably not load at all, we would prefer this module to initialize correctly always. If I were to throw a runtime exception, it would get into the logs, and just get ignored since the application will continue anyway, and the end users would never know... I know that errors are meant to be thrown only under exceptional conditions, and they generally have to do with situations that the system cannot recover from, but what would you do in such a situation?

    Read the article

  • ASP.NET MVC - How to Preserve ModelState Errors Across RedirectToAction?

    - by RPM1984
    Hi Guys, I have the following two action methods (simplified for question): [HttpGet] public ActionResult Create(string uniqueUri) { // get some stuff based on uniqueuri, set in ViewData. return View(); } [HttpPost] public ActionResult Create(Review review) { // validate review if (validatedOk) { return RedirectToAction("Details", new { postId = review.PostId}); } else { ModelState.AddModelError("ReviewErrors", "some error occured"); return RedirectToAction("Create", new { uniqueUri = Request.RequestContext.RouteData.Values["uniqueUri"]}); } } So, if the validation passes, i redirect to another page (confirmation). If an error occurs, i need to display the same page with the error. If i do return View(), the error is displayed, but if i do return RedirectToAction (as above), it loses the Model errors. I'm not surprised by the issue, just wondering how you guys handle this? I could of course just return the same View instead of the redirect, but i have logic in the "Create" method which populates the view data, which i'd have to duplicate. Any suggestions?

    Read the article

  • Can you catch exceeded allocated memory error before it kills the script?

    - by kristovaher
    The thing is that I want to catch memory problems before they happen. I have a system that gets rows from database and casts the returned associative array to a variable, but I never know what the size of the database result is is or how much memory it will take once the database request is made. This means that my software can fail simply because memory is exceeded. But I want to avoid that somehow. One of the ways is to obviously make database requests that are smaller, but what if this is not possible or what if I do not know the size of data that is returned from database? Is it possible to 'catch' situations where memory use is exceeded in PHP? Something like this: $requestOk=memory_test(function(){ return doSomething(); }); if($requestOk){ // Memory seems fine // $requestOk now has the value from memory_test() function } else { // Function would have exceeded memory } I just find it problematic that my script can just die at any moment because of memory issues. From what I know, try-catch cannot be used here because it is a fatal error. Any help would be appreciated!

    Read the article

  • What to log when an exception occurs?

    - by Rune
    public void EatDinner(string appetizer, string mainCourse, string dessert) { try { // Code } catch (Exception ex) { Logger.Log("Error in EatDinner", ex); return; } } When an exception occurs in a specific method, what should I be logging? I see a lot of the above in the code I work with. In these cases, I always have to talk to the person who experienced the error to find out what they were doing, step through the code, and try to reproduce the error. Is there any best practices or ways I can minimize all this extra work? Should I log the parameters in each method like this? Logger.Log("Params: " + appetizer + "," + mainCourse + "," + dessert, ex); Is there a better way to log the current environment? If I do it this way, will I need to write out all this stuff for each method I have in my application? Are there any best practices concerning scenarios like this?

    Read the article

  • handling ImageList with windows hooks

    - by user337309
    Hi, I am programming an application that can catching the information about the screen items by Hooks Now I am trying to get the information of the ImageList when I pass them by mouse, "I want to know the name of the item" how can i do this? Thank you.

    Read the article

  • Is it possible to call the main(String[] args) after catching an exception?

    - by Jason
    I'm working on a Serpinski triangle program that asks the user for the levels of triangles to draw. In the interests of idiot-proofing my program, I put this in: Scanner input= new Scanner(System.in); System.out.println(msg); try { level= input.nextInt(); } catch (Exception e) { System.out.print(warning); //restart main method } Is it possible, if the user punches in a letter or symbol, to restart the main method after the exception has been caught?

    Read the article

  • what happens when two exceptions occur?

    - by ashish yadav
    what will the operating system and compiler behave when they have two exceptions. And none of them have been caught yet. what type of handler will be called . lets say both the exceptions were of different type. i apologize if i am not clear but i feel i have made myself clear enough. thank you!!!

    Read the article

< Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >