mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
attempt to make the failed-to-load-entity-script error-message be more helpful
This commit is contained in:
parent
e76a04951c
commit
21c2db7cdc
1 changed files with 12 additions and 3 deletions
|
@ -1089,9 +1089,18 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!testConstructor.isFunction()) {
|
if (!testConstructor.isFunction()) {
|
||||||
qCDebug(scriptengine) << "ScriptEngine::loadEntityScript() entity:" << entityID << "\n"
|
QString testConstructorType = QString(testConstructor.toVariant().typeName());
|
||||||
" NOT CONSTRUCTOR\n"
|
if (testConstructorType == "") {
|
||||||
" SCRIPT:" << scriptOrURL;
|
testConstructorType = "empty";
|
||||||
|
}
|
||||||
|
QString testConstructorValue = testConstructor.toString();
|
||||||
|
if (testConstructorValue.size() > 80) {
|
||||||
|
testConstructorValue = testConstructorValue.mid(0, 80) + "...";
|
||||||
|
}
|
||||||
|
qCDebug(scriptengine) << "Error -- ScriptEngine::loadEntityScript() entity:" << entityID
|
||||||
|
<< "failed to load entity script -- expected a function, got " + testConstructorType
|
||||||
|
<< "," << testConstructorValue
|
||||||
|
<< "," << scriptOrURL;
|
||||||
|
|
||||||
if (!isFileUrl) {
|
if (!isFileUrl) {
|
||||||
scriptCache->addScriptToBadScriptList(scriptOrURL);
|
scriptCache->addScriptToBadScriptList(scriptOrURL);
|
||||||
|
|
Loading…
Reference in a new issue