         else if typeof child.handler is 'function'
           child.module = parent.module
         else
-          throw Error "Invalid handler: #{child.handler}"
+          throw Error "Invalid handler: #{child.handler}, in module #{parent.module}"
         child.command ?= command
         m = load_module(ctx, child, default_command, command)
         middlewares.push m... if m

  middlewares = []
  parent = module: parent if typeof parent is 'string'
  plugin = false
  if not parent.handler or typeof parent.handler is 'string'
    absname = parent.module
    absname = path.resolve process.cwd(), parent.module if parent.module.substr(0, 1) is '.'

    middlewares.push module: parent.module, plugin: true
    commands = parent.handler.call ctx
    return unless commands
    return if commands.registry
    # return if commands is ctx
    for command, children of commands
      # when a plugin reference another plugin, we need to filterout other
      # commands while preserving configure
