 
 DHT::_onQuery = (addr, message) ->
   query = message.q.toString()
-  if typeof @queryHandler[query] == 'function'
-    @queryHandler[query].call @, addr, message
+  handler = @queryHandler[query]
+  @_debug "handler:", handler.name
+  if typeof handler == "object"
+    return handler.handle message
   else
-    errMessage = 'unexpected query type'
-    @_debug errMessage
-    @_sendError addr, message.t, ERROR_TYPE.METHOD_UNKNOWN, errMessage
+    throw new TypeError "unexpected query type"
 
 ###*
 # Called when another node sends a response or error.

      localNodeId: @nodeId
      numberOfNodesPerKBucket: K
      numberOfNodesToPing: MAX_CONCURRENCY

    ###*
    # Cache of routing tables used during a lookup. Saved in this object so we can access

  @_query { q: 'ping' }, addr, cb

###*
# Send "find_node" query to given addr.
# @param {string} addr
# @param {Buffer} nodeId
