mirror of https://github.com/vitalif/phantomjs
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
parent
e52ed4a54a
commit
9ed0c2951e
|
@ -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]
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue