summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-08-27 09:53:22 +0200
committerGitHub <noreply@github.com>2017-08-27 09:53:22 +0200
commit73d2504fce8ac28c32704e8fdf53fc3425f4e193 (patch)
treeb15a5b7122c0f9ecb1bbed6b40b9950bbaa13ad9
parent5f18b56a7ebb6130eaaa38bd54ed7e0f3b8774ff (diff)
parent4940f490c43274ce91234b8d3c8f29672baa7b4a (diff)
Merge pull request #10682 from Noshyaar/pr-csv
ImporterCSV: print error condition to console
-rw-r--r--editor/import/resource_importer_csv_translation.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/editor/import/resource_importer_csv_translation.cpp b/editor/import/resource_importer_csv_translation.cpp
index 9214b8f45e..226565f69f 100644
--- a/editor/import/resource_importer_csv_translation.cpp
+++ b/editor/import/resource_importer_csv_translation.cpp
@@ -83,9 +83,7 @@ Error ResourceImporterCSVTranslation::import(const String &p_source_file, const
ERR_FAIL_COND_V(!f, ERR_INVALID_PARAMETER);
Vector<String> line = f->get_csv_line();
- if (line.size() <= 1) {
- return ERR_PARSE_ERROR;
- }
+ ERR_FAIL_COND_V(line.size() <= 1, ERR_PARSE_ERROR);
Vector<String> locales;
Vector<Ref<Translation> > translations;
@@ -93,9 +91,8 @@ Error ResourceImporterCSVTranslation::import(const String &p_source_file, const
for (int i = 1; i < line.size(); i++) {
String locale = line[i];
- if (!TranslationServer::is_locale_valid(locale)) {
- return ERR_PARSE_ERROR;
- }
+ ERR_EXPLAIN("Error importing CSV translation: '" + locale + "' is not a valid locale");
+ ERR_FAIL_COND_V(!TranslationServer::is_locale_valid(locale), ERR_PARSE_ERROR);
locales.push_back(locale);
Ref<Translation> translation;