def __init__(self, pipeline, errors, config_value, *args, **kwargs): from dagster.core.definitions import PipelineDefinition from dagster.core.types.evaluator.errors import friendly_string_for_error, EvaluationError self.pipeline = check.opt_inst_param(pipeline, 'pipeline', PipelineDefinition) self.errors = check.list_param(errors, 'errors', of_type=EvaluationError) self.config_value = config_value if pipeline is not None: error_msg = 'Pipeline "{pipeline}" config errors:'.format( pipeline=pipeline.name) else: error_msg = 'Config errors:' error_messages = [] for i_error, error in enumerate(self.errors): error_message = friendly_string_for_error(error) error_messages.append(error_message) error_msg += '\n Error {i_error}: {error_message}'.format( i_error=i_error + 1, error_message=error_message) self.message = error_msg self.error_messages = error_messages super(DagsterInvalidConfigError, self).__init__(error_msg, *args, **kwargs)
def __init__(self, pipeline, errors, config_value, *args, **kwargs): self.pipeline = check.inst_param(pipeline, 'pipeline', PipelineDefinition) self.errors = check.list_param(errors, 'errors', of_type=EvaluationError) self.config_value = config_value error_msg = 'Pipeline "{pipeline}" config errors:'.format( pipeline=pipeline.name) error_messages = [] for i_error, error in enumerate(self.errors): error_message = friendly_string_for_error(error) error_messages.append(error_message) error_msg += '\n Error {i_error}: {error_message}'.format( i_error=i_error + 1, error_message=error_message) self.message = error_msg self.error_messages = error_messages super(PipelineConfigEvaluationError, self).__init__(error_msg, *args, **kwargs)