On Coffee convert error, just warn and return nothing.

The reason for this is for consistencies sake. When we have a JavaScript
evaluation error, it shows the error, but doesn't exit the program.
Since we can inject CoffeeScripts as well as JS, it wouldn't be
consistent to exit the program. So we just warn instead.
1.2
IceArmy 2011-06-16 21:30:10 -07:00
parent e52ed4a54a
commit 9ed0c2951e
2 changed files with 5 additions and 4 deletions

View File

@ -19,7 +19,7 @@
import sys
from PyQt4.QtCore import QObject, QFile
from PyQt4.QtCore import QObject, QFile, qWarning
from PyQt4.QtWebKit import QWebPage
@ -45,5 +45,6 @@ class CSConverter(QObject):
[false, error.message];
}''')
if result[0] is False:
sys.exit(result[1])
qWarning(result[1])
return ''
return result[1]

View File

@ -58,8 +58,8 @@ QString CSConverter::convert(const QString &script)
" [false, error.message];" \
"}");
if (result.toStringList().at(0) == "false") {
qCritical(qPrintable(result.toStringList().at(1)));
exit(1);
qWarning(qPrintable(result.toStringList().at(1)));
return QString();
}
return result.toStringList().at(1);
}