Ensures the trace is always last
optimize error handler
interface for logging caught exceptions