e.printStackTrace() prints the whole stacktrace i.e at which line error occured,what message was displayed and which exception was thrown at console
e.getMessage() only prints which error occured but does give the line number or what exception was thrown.