Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  One thought about JavaScript exception handle

Due to network, browser and cache issues, the JS executed in production may produce different results from the testing environments. Sometimes they may produce exceptions. Front-end developers may encounter this kind of exceptions frequently. But how to log and use them is seldomly considered by them. Actually, exception handling includes two steps : log and use.1. LogRegarding to log error, this is relatively convenient, since in each browser, there is one interface called window.onerror.window.onerror =function(errorMessage, scriptURL, lineNumber){ alert(errorMessage, scriptURL, lineNumber)...

2,238 0       EMAIL LOG EXCEPTION JAAVSCRIPT


  Custom C++ exception class creation

In standard C++, we can use try catch to catch and exception when something goes wrong. These are some built in exception support in C++. By including the #include , we can now catch exceptions in C++ programs. This actually helps us on debugging our code and reduce the maintenance work.However sometimes if we want to create our own custom exception class. What should we do?We should include the #include line and then extend the exception class and implement some methods as you like. The general format is :#include using namespace std;class MyException:public exception{public:  &nbs...

31,472 2       C++ IMPLEMENTATION STD EXCEPTION CUSTOM EXCEPTION