private boolean findErrorDirective() {
        Hop hop = route.getHop(0);
        for (int i = 0; i < hop.getNumDirectives(); ++i) {
            HopDirective dir = hop.getDirective(i);
            if (dir instanceof ErrorDirective) {
                setError(ErrorCode.ILLEGAL_ROUTE, ((ErrorDirective)dir).getMessage());
                return true;
            }
        }
        return false;
    }
This method traverses the current hop looking for an instance of {@link ErrorDirective}. If one is found, this
method assigns a corresponding error reply to this node.

@return True if an error was found.
messagebus/src/main/java/com/yahoo/messagebus/routing/RoutingNode.java