Systems | Development | Analytics | API | Testing


PHP Nested Try-Catch

Try-catch blocks in PHP can be nested up to any desired levels and are handled in reverse order of appearance i.e. innermost exceptions are handled first. Nested blocks can be useful in case a block of code causes an exception, which can be handled within that block and program execution can continue in the outer block. They can also be useful in case the handling of an exception causes another exception.

Javascript Guide: Resolving the Reference Error

The Javascript ReferenceError occurs when referencing a variable that does not exist or has not yet been initialized in the current scope. Reference errors in Javascript are of a few different types, with variations of each, that may get triggered in code. Some of these are discussed below.

How to Implement Custom Exceptions in C++

Under certain conditions, custom exceptions that are not predefined in C++ may be useful to generate. In C++, any type can be caught or thrown that matches some requirements. These are that the type should have a valid copy constructor and destructor. Custom exceptions provide relevant information about an error to the exception handling mechanism.

How to Handle the Clone Not Supported Exception in Java

The CloneNotSupportedException is an exception in Java that is thrown to indicate that the clone() method in class Object was called to clone an object, but that object's class does not implement the Cloneable interface. Applications that override the clone() method can also throw this exception to indicate that an object could not or should not be cloned.

How to Resolve the Instantiation Exception in Java

The InstantiationException is a runtime exception in Java that occurs when an application attempts to create an instance of a class using the Class.newInstance() method, but the specified class object cannot be instantiated. Since the InstantiationException is an unchecked exception, it does not need to be declared in the throws clause of a method or constructor.