Skip to content

Commit

Permalink
Merge pull request #67 from civitaspo/fix/config_error
Browse files Browse the repository at this point in the history
Catch any initialization exception and re-throw as ConfigException
  • Loading branch information
civitaspo authored Jul 29, 2019
2 parents 922cc09 + f03d982 commit bd7f04c
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package pro.civitaspo.digdag.plugin.athena
import java.lang.reflect.Constructor
import java.util.{Arrays => JArrays, List => JList}

import io.digdag.client.config.Config
import io.digdag.client.config.{Config, ConfigException}
import io.digdag.spi.{Operator, OperatorContext, OperatorFactory, OperatorProvider, Plugin, TemplateEngine}
import javax.inject.Inject
import pro.civitaspo.digdag.plugin.athena.add_partition.AthenaAddPartitionOperator
Expand Down Expand Up @@ -62,7 +62,12 @@ object AthenaPlugin
classOf[OperatorContext],
classOf[Config],
classOf[TemplateEngine])
constructor.newInstance(operatorName, context, systemConfig, templateEngine)
try {
constructor.newInstance(operatorName, context, systemConfig, templateEngine)
}
catch {
case e: Throwable => throw new ConfigException(e)
}
}
}
}
Expand Down

0 comments on commit bd7f04c

Please sign in to comment.