diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-03-21 21:17:57 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-03-23 17:09:54 +0100 |
commit | 84f5d3fca336730508eeb0144d4ee42feff34f0c (patch) | |
tree | 07e589a8a9f61aaf1b0a2c2c89651e9967a589a0 /sources/shiboken2/ApiExtractor/messages.cpp | |
parent | fc7f5f15292886790b45ab114d93a873564f95d6 (diff) |
shiboken: Improve error messages about invalid types of added functions
Change translateType() to pass up the error instead of aborting so
that the error is printed in traverseFunction() along with the name.
The abort in case of failure will then occur in fillAddedFunctions().
Task-number: PYSIDE-946
Task-number: PYSIDE-1241
Change-Id: Iee9ca478b28c8f82d9c4b6c5165f3028bf1e0d08
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/messages.cpp')
-rw-r--r-- | sources/shiboken2/ApiExtractor/messages.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/messages.cpp b/sources/shiboken2/ApiExtractor/messages.cpp index 546e9c4ed..0eb3c607f 100644 --- a/sources/shiboken2/ApiExtractor/messages.cpp +++ b/sources/shiboken2/ApiExtractor/messages.cpp @@ -107,6 +107,28 @@ static void msgFormatEnumType(Stream &str, str << " (class: " << className << ')'; } +QString msgAddedFunctionInvalidArgType(const QString &addedFuncName, + const QString &typeName, + int pos, const QString &why) +{ + QString result; + QTextStream str(&result); + str << "Unable to translate type \"" << typeName << "\" of argument " + << pos << " of added function \"" << addedFuncName << "\": " << why; + return result; +} + +QString msgAddedFunctionInvalidReturnType(const QString &addedFuncName, + const QString &typeName, const QString &why) +{ + QString result; + QTextStream str(&result); + str << "Unable to translate return type \"" << typeName + << "\" of added function \"" << addedFuncName << "\": " + << why; + return result; +} + QString msgNoEnumTypeEntry(const EnumModelItem &enumItem, const QString &className) { |