func Wrap(handler Handler) tchannel.Handler {
	return tchannel.HandlerFunc(func(ctx context.Context, call *tchannel.InboundCall) {
		args, err := ReadArgs(call)
		if err != nil {
			handler.OnError(ctx, err)
			return
		}

		resp, err := handler.Handle(ctx, args)
		response := call.Response()
		if err != nil {
			resp = &Res{
				SystemErr: err,
			}
		}
		if err := WriteResponse(response, resp); err != nil {
			handler.OnError(ctx, err)
		}
	})
}
func Wrap(handler Handler) tchannel.Handler {
	return tchannel.HandlerFunc(func(ctx context.Context, call *tchannel.InboundCall) {
		args, err := ReadArgs(call)
		if err != nil {
			handler.OnError(ctx, err)
			return
		}

		resp, err := handler.Handle(ctx, args)
		response := call.Response()
		if err != nil {
			resp = &Res{
				SystemErr: err,
			}
		}
		if err := WriteResponse(response, resp); err != nil {
			handler.OnError(ctx, err)
		}
	})
}
func Wrap ( handler Handler ) tchannel . Handler { return tchannel . HandlerFunc ( func ( ctx context . Context , call * tchannel . InboundCall ) { args , err := ReadArgs ( call ) if err != nil { handler . OnError ( ctx , err ) return } resp , err := handler . Handle ( ctx , args ) response := call . Response ( ) if err != nil { resp = & Res { SystemErr : err , } } if err := WriteResponse ( response , resp ) ; err != nil { handler . OnError ( ctx , err ) } } ) }
// Wrap wraps a Handler as a tchannel.Handler that can be passed to tchannel.Register.
Wrap wraps a Handler as a tchannel . Handler that can be passed to tchannel . Register .