utility dlambda error handling and with-thread macro