fix error stack output in production context