What are the exception class functions?

Technology CommunityCategory: PHPWhat are the exception class functions?
VietMX Staff asked 4 years ago

There are following functions which can be used from Exception class.

  • getMessage() − message of exception
  • getCode() − code of exception
  • getFile() − source filename
  • getLine() − source line
  • getTrace() − n array of the backtrace()
  • getTraceAsString() − formated string of trace
  • Exception::__toString gives the string representation of the exception.