ErrorController: Log exception and stacktrace

refe #5896