exception-handling

Does a legitmate epilog need to include a dummy rsp adjustment even if not otherwise necessary?

末鹿安然 提交于 2019-12-07 21:24:36
问题 The x86-64 Windows ABI has the concept of a legitimate epilog , which is a special type of function epilog that can be simulated during exception handling in order to restore the callers context 1 as described here: If the RIP is within an epilog [when an exception occurs], then control is leaving the function, ... and the effects of the epilog must be continued to compute the context of the caller function. To determine if the RIP is within an epilog, the code stream from RIP on is examined.

Handling exceptions in a Swing UI (low level to high level and exception wrapping)

ぐ巨炮叔叔 提交于 2019-12-07 18:48:24
问题 I wish to handle Exceptions in a meaningful way in a Swing application. The following is inside an actionPerformed method. The UiUtils#showError displays a JOptionPane with a button that shows/hides the stack trace. ApplicationException is a custom class to translate low level Exceptions to something a user would understand. One issue is that I'm not sure how to handle a NullPointerException that propagates up if a user doesn't select a file in the JFileChooser before this code. The

Laravel 5 override exception handler

穿精又带淫゛_ 提交于 2019-12-07 18:23:37
问题 I'd like to know if it's possible to override the application exception handler class in Laravel 5 without extending it to another class. Maybe a better way of saying it is that I'd like it so that not App\Exceptions\Handler will be called on an exception but one of my own handlers. Thanks in advance. 回答1: As mentioned before by Digitlimit here Laravel ships with default ExceptionHandler which can be overwritten. There's two ways you can do so: Adjusting the implemented ExceptionHandler

Java exception handling - catching superclass exception

醉酒当歌 提交于 2019-12-07 18:16:59
问题 I have a question on handling exception in web application. Often I hear catching the super class Exception is a bad idea. Often I write codes to catch all exceptions in struts action / java servlet classes. try { // call business facade // business facade calls DAO // any exception from DAO bubbles up } catch (Exception e) { log.error("error", e); } If we do not catch superclass Exception. How do we handle any unexpected runtime errors and logged them appropriately 回答1: You can setup a

Is the lifetime of an exception affected by nested handlers?

帅比萌擦擦* 提交于 2019-12-07 17:45:23
问题 Consider the following code snippet: struct ExceptionBase : virtual std::exception{}; struct SomeSpecificError : virtual ExceptionBase{}; struct SomeOtherError : virtual ExceptionBase{}; void MightThrow(); void HandleException(); void ReportError(); int main() { try { MightThrow(); } catch( ... ) { HandleException(); } } void MightThrow() { throw SomeSpecificError(); } void HandleException() { try { throw; } catch( ExceptionBase const & ) { // common error processing } try { throw; } catch(

unhandled exceptions in a windows service

青春壹個敷衍的年華 提交于 2019-12-07 17:40:55
问题 I have created a .net c# windows service that runs multiple tasks. I included exception handling in it but I would like to set up a global handler to catch unhandled exceptions in the windows service, how can I do this? 回答1: I included exception handling in it but I would like to set up a global handler to catch unhandled exceptions in the windows service You could use AppDomain.UnhandledException . In your case however, your entire call to your service can be wrapped in a try/catch block.

How to pass and receive objects using JNI

≡放荡痞女 提交于 2019-12-07 17:28:11
问题 I have an JAVA application in that I want to pass the object as a parameter to the C code using JNI and again I want to receive the object from the C code to JAVA using JNI . In JAVA side i have simply created an application and pass it to the method as shown bellow JlibFprint.fp_image_data fpimg = new JlibFprint.fp_image_data(); //object to be pass //fp_image_data is the static inner class of the class JlibFprint JlibFprint.fp_image_data fpimg1 = new JlibFprint.fp_image_data(); //received

Weird issue with catching trivial boost exception

≯℡__Kan透↙ 提交于 2019-12-07 17:20:20
问题 I have an issue with the following straightforward code: try { boost::lexical_cast<unsigned int>("invalid string"); } catch(::boost::bad_lexical_cast &) { //It's not catched!!! return; } catch (std::exception &e){ std::cerr << boost::diagnostic_information(e) << std::endl; ::boost::bad_lexical_cast s; std::string ss = typeid(s).name(); std::cout << "'" << s.what()<<"': '"<< ss <<"'"; std::string ee = typeid(e).name(); std::cout << "'" << e.what()<<"': '"<< ee <<"'"; } The boost::bad_lexical

Does PDO fetch() throw an exception on failure?

折月煮酒 提交于 2019-12-07 17:16:55
问题 Does the method PDOStatement::fetch() throw an exception on failure, if the PDO error reporting system is set to throw exceptions? E.g. if I set: PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION Do you know such a case? Thank you very much. UPDATE: The method PdoStatement::fetch throws indeed exceptions on failure, instead of FALSE . Such a case is demonstrated in my answer: Simulate a PDO fetch failure situation In conclusion: PDOStatement::fetch returns FALSE if no records are found.

Exception “Illegal character in query at index -” in Android

雨燕双飞 提交于 2019-12-07 16:33:17
问题 I am trying to send data on server using following link. **WEBSERVICE LINK:** http://75.125.237.76/post_reviews.php?data=text1 If I set data filed with single string (ex:data=text1), That time my try block in source code working fine, without any exception. But When I set data field with multiple string with spaces (ex: data=text1 text2 text3), Then Exception generated i.e. Illegal character in query. **EXCEPTION:** Illegal character in query at index 75: http://75.125.237.76/post_reviews.php