diff options
| author | Peter LaFosse <peter@vector35.com> | 2017-07-14 18:11:03 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2017-07-15 14:17:18 -0400 |
| commit | 544869aa61c0ab24b19a7e20a6b83faad03c98f1 (patch) | |
| tree | 6f9daedb7922295ab326088210ddcb7aa6c79406 /python | |
| parent | 6110eaaafe12cac0339cb0bdcc135e1b3f2c2220 (diff) | |
Give error message when license validation fails
Diffstat (limited to 'python')
| -rw-r--r-- | python/generator.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/python/generator.cpp b/python/generator.cpp index 6f19db66..554f82cd 100644 --- a/python/generator.cpp +++ b/python/generator.cpp @@ -165,8 +165,15 @@ int main(int argc, char* argv[]) // Parse API header to get type and function information map<QualifiedName, Ref<Type>> types, vars, funcs; string errors; - bool ok = Architecture::GetByName("generator")->ParseTypesFromSourceFile(argv[1], types, vars, funcs, errors); - fprintf(stderr, "%s", errors.c_str()); + auto arch = Architecture::GetByName("generator"); + if (!arch) + { + printf("ERROR: License file validation failed (most likely)\n"); + return 1; + } + + bool ok = arch->ParseTypesFromSourceFile(argv[1], types, vars, funcs, errors); + fprintf(stderr, "Errors: %s", errors.c_str()); if (!ok) return 1; |
