From 5033a9de732963dfcadc42ad381df00b69cf624d Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 18 Nov 2016 22:29:49 +0200 Subject: [PATCH] Check for some errors in SourceGenerator --- source/sourcegenerator.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/sourcegenerator.cpp b/source/sourcegenerator.cpp index 9acd696..f00b26b 100644 --- a/source/sourcegenerator.cpp +++ b/source/sourcegenerator.cpp @@ -24,6 +24,8 @@ Target *SourceGenerator::create_target(const list &sources, const stri { if(sources.size()!=1) throw invalid_argument("SourceGenerator::create_target"); + if(out_suffixes.empty()) + throw logic_error("No output suffixes"); TemplateFile &tmpl = dynamic_cast(*sources.front()); const Component *comp = tmpl.get_component(); @@ -45,6 +47,8 @@ Target *SourceGenerator::create_target(const list &sources, const stri else primary = target; } + else + throw runtime_error("No tool found for suffix "+*i); } return primary; -- 2.45.2