Php exception handling and php exception capture. Php exception handling. php exception capture uses the try {thow} catch () {} exception handling structure to effectively control code that may cause exceptions in multiple lines. The basic model is as follows :? Phptry {thrownewExc php exception handling, php exception capture
The try {thow} catch () {} exception handling structure can effectively control multiple lines of code that may cause exceptions. The basic model is as follows:
GetMessage (); // output error message echo $ e-> getCode (); // returns the exception code echo $ e-> getFile (); // return the abnormal file echo $ e-> getLine (); // return the abnormal row number}?>
Exception:
At the same time, a try can also be associated with multiple catch blocks. you can customize the class to inherit the Exception class.
Pipeline uses the try {thow} catch () {} exception handling structure to effectively control multiple lines of code that may cause exceptions. The basic model is as follows :? Php try {throw new Exc...