Log the error's stack if available.