﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.SqlServer.Dts.Runtime;

namespace NBi.Core.Etl.IntegrationService
{
    abstract class EtlRunner: IEtlRunner
    {
        public IEtl Etl { get; private set; }

        public EtlRunner(IEtl etl)
        {
            Etl = etl;
        }

        public abstract IExecutionResult Run();

        public void Execute()
        {
            Run();
        }
    }
}

﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.SqlServer.Dts.Runtime;

namespace NBi.Core.Etl.IntegrationService
{
    abstract class EtlRunner: IEtlRunner
    {
        public IEtl Etl { get; private set; }

        public EtlRunner(IEtl etl)
        {
            Etl = etl;
        }

        public abstract IExecutionResult Run();

        public void Execute()
        {
            var result = Run();
            if (result.IsFailure)
                throw new Exception(result.Message);
        }
    }
}

Enforce an exception when the ETL has failed
Enforce an exception when the ETL has failed
