Raises an error when the given block does not register a plugin.
434148
def validate_file_contains_plugin!(file)
      plugin_count_was = Danger::Plugin.all_plugins.length
      yield

      if Danger::Plugin.all_plugins.length == plugin_count_was
        raise("#{file} doesn't contain any valid danger plugins.")
      end
    end
606870
def get_error(self, block = True, timeout = None):
		
		return self._error_queue.get(block = block, timeout = timeout)
209961
function raise(err, parameters, cause) {
  if(!(err instanceof Error)) {
    err = wrap(err, parameters, cause);
  }
  throw err;
}
755161
def add_deferred_block(context, &block)
      context ||= @context
      if context.nil? && @assign_root
        context ||= self.create_default_root_context
      end
      raise InvalidDeferredError.new('deferred must be run inside of a context') unless context
      raise ArgumentError.new('Block required') unless block

      self.deferred_blocks << [context, block]
    end
899959
def convert(self, plugin=None):
        
        if plugin:
            plugin = kurt.plugin.Kurt.get_plugin(plugin)
            if plugin.name in self._plugins:
                return self._plugins[plugin.name]
            else:
                err = BlockNotSupported("%s doesn't have %r" %
                        (plugin.display_name, self))
                err.block_type = self
                raise err
        else:
            return self.conversions[0]
80465
public function addBlock(Block $block)
	{
		if ($this->lock('block')) {
			$this->matchDiscriminator($block);
			if ($this->addUnique($this->blocks, $block)) {
				$block->setPlaceHolder($this);
			}
			$this->unlock('block');
		}
	}
160328
private void checkBlockDefinitionsComplete() throws MiniTemplator.TemplateSyntaxException {
        for (int blockNo = 0; blockNo < blockTabCnt; blockNo++) {
            BlockTabRec btr = blockTab[blockNo];
            if (btr.definitionIsOpen) {
                throw new MiniTemplator.TemplateSyntaxException(
                        "Missing $EndBlock command in template for block \"" + btr.blockName + "\".");
            }
        }
        if (currentNestingLevel != 0) {
            throw new MiniTemplator.TemplateSyntaxException("Block nesting level error at end of template.");
        }
    }
55003
function wrapError(err) {
	if (err && !(err instanceof gutil.PluginError)) {
		err = new PluginError(err.plugin || PLUGIN_NAME, err, {
			showStack: (err.showStack !== false)
		});
	}
	return err;
}
489131
private function checkAndRegisterNoMultiLine(): void
    {
        $docCommentPos = $this->getDocCommentPos();
        $openingToken = $this->tokens[$docCommentPos];
        $closingToken = $this->tokens[$openingToken['comment_closer']];

        if ($openingToken['line'] === $closingToken['line']) {
            $tokenIdent = $this->getTokenName();

            $exception = (new CodeError(
                static::CODE_NO_MULTI_LINE_DOC_BLOCK_PREFIX . ucfirst($tokenIdent),
                self::MESSAGE_NO_MULTI_LINE_DOC_BLOCK_PREFIX,
                $docCommentPos
            ))->setPayload([lcfirst($tokenIdent)]);

            throw $exception;
        }
    }
1280026
def validate(self, inputs=None):
        
        # if no blocks...
        if not len(self._blocks):
            #TODO: find better error than ReliureError ?
            raise ReliureError("There is no block in this engine")
        # it block should be ok with it-self
        for block in self:
            block.validate()
        # check the inputs and outputs
        # note: fornow only the first block can have user given input
        available = set()       # set of available data
        maybe_available = set() # data that are produced be not required blocks
        # add the first block input as available data
        if inputs is not None:
            for in_name in inputs:
                available.add(in_name)
        else:
            # no inputs given, then consider that the first block input will be given
            if self.in_name is not None:
                for in_name in self.in_name:
                    available.add(in_name)
            else:
                # default input name if nothing specified
                available.add(Engine.DEFAULT_IN_NAME)
        needed = self.needed_inputs()
        miss = needed.difference(available)
        if len(miss):
            raise ReliureError("The following inputs are needed and not given: %s" % (",".join("'%s'" % in_name for in_name in miss)))
        no_need = available.difference(needed)
        if len(no_need):
            raise ReliureError("The following inputs are given but not needed: %s" % (",".join("'%s'" % in_name for in_name in no_need)))
        return
319260
function registerPlugin(type, Plugin) {
    if (!plugins[type]) {
      throw new Error('Attempting to register "' + Plugin + '" as "' + type + '" which is not a valid HTMLBars plugin type.');
    }

    plugins[type].push(Plugin);
  }
402436
function( name, match, block ) {
		var self = this, result = { passed: false, extra: 'Block did not throw error' };

		// Variable arguments
		if ( block === undefined && munit.isFunction( match ) ) {
			block = match;
			match = undefined;
		}

		// Fail quick if block isn't a function
		if ( ! munit.isFunction( block ) ) {
			throw new Error( "Block passed to assert.throws is not a function: '" + block + "'" );
		}

		// test for throwing
		try {
			block();
		}
		catch ( e ) {
			result = self._errorMatch( e, match );
		}

		return self.ok( name, result.passed, self.throws, result.extra );
	}
720030
def set_blocked(self, name):
        
        self.unregister(name=name)
        self._name2plugin[name] = None
533650
def RaiseIfNotErrorSuccess(result, func = None, arguments = ()):
    
    if result != ERROR_SUCCESS:
        raise ctypes.WinError(result)
    return result
1304385
def _sanity_check_query_root_block(ir_blocks):
    """"""
    if not isinstance(ir_blocks[0], QueryRoot):
        raise AssertionError(u'The first block was not QueryRoot: {}'.format(ir_blocks))
    for block in ir_blocks[1:]:
        if isinstance(block, QueryRoot):
            raise AssertionError(u'Found QueryRoot after the first block: {}'.format(ir_blocks))
597262
def method_missing(*args, &block)
      if Namespace.exists?(args.first)
        create_namespace(args.first)
      else
        call_method(args, &block)
      end
    end
1079067
void addToInvalidatesNoLog(Block b, DatanodeInfo n, boolean ackRequired) {
    // We are the standby avatar and we don't want to add blocks to the
    // invalidates list.
    if (this.getNameNode().shouldRetryAbsentBlocks()) {
      return;
    }

    LightWeightHashSet<Block> invalidateSet = recentInvalidateSets.get(n
        .getStorageID());
    if (invalidateSet == null) {
      invalidateSet = new LightWeightHashSet<Block>();
      recentInvalidateSets.put(n.getStorageID(), invalidateSet);
    }
    if(!ackRequired){
      b.setNumBytes(BlockFlags.NO_ACK);
    }
    if (invalidateSet.add(b)) {
      pendingDeletionBlocksCount++;
    }
  }