mirror of https://github.com/vitalif/phantomjs
Maintain consistency across error messages
parent
6e2b362850
commit
ff3eb34fc1
|
@ -40,7 +40,7 @@ CSConverter::CSConverter(QObject *parent)
|
||||||
{
|
{
|
||||||
QFile file(":/coffee-script.js");
|
QFile file(":/coffee-script.js");
|
||||||
if (!file.open(QFile::ReadOnly)) {
|
if (!file.open(QFile::ReadOnly)) {
|
||||||
qFatal("CoffeeScript compiler is not available!");
|
std::cerr << "CoffeeScript compiler is not available!" << std::endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
QString script = QString::fromUtf8(file.readAll());
|
QString script = QString::fromUtf8(file.readAll());
|
||||||
|
|
|
@ -164,13 +164,13 @@ Phantom::Phantom(QObject *parent)
|
||||||
|
|
||||||
QFile file(":/bootstrap.js");
|
QFile file(":/bootstrap.js");
|
||||||
if (!file.open(QFile::ReadOnly)) {
|
if (!file.open(QFile::ReadOnly)) {
|
||||||
qCritical() << "Can not bootstrap!";
|
std::cerr << "Can not bootstrap!" << std::endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
QString bootstrapper = QString::fromUtf8(file.readAll());
|
QString bootstrapper = QString::fromUtf8(file.readAll());
|
||||||
file.close();
|
file.close();
|
||||||
if (bootstrapper.isEmpty()) {
|
if (bootstrapper.isEmpty()) {
|
||||||
qCritical() << "Can not bootstrap!";
|
std::cerr << "Can not bootstrap!" << std::endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
m_page->mainFrame()->evaluateJavaScript(bootstrapper);
|
m_page->mainFrame()->evaluateJavaScript(bootstrapper);
|
||||||
|
|
|
@ -42,7 +42,7 @@ void Utils::showUsage()
|
||||||
QFile file;
|
QFile file;
|
||||||
file.setFileName(":/usage.txt");
|
file.setFileName(":/usage.txt");
|
||||||
if ( !file.open(QFile::ReadOnly) ) {
|
if ( !file.open(QFile::ReadOnly) ) {
|
||||||
qFatal("Unable to print the usage message");
|
std::cerr << "Unable to print the usage message" << std::endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
std::cout << qPrintable(QString::fromUtf8(file.readAll()));
|
std::cout << qPrintable(QString::fromUtf8(file.readAll()));
|
||||||
|
@ -107,7 +107,7 @@ bool Utils::injectJsInFrame(const QString &jsFilePath, const QString &libraryPat
|
||||||
jsFile.close();
|
jsFile.close();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "Can't open '" << qPrintable(jsFilePath) << "'" << std::endl << std::endl;
|
qWarning() << "Can't open '" << qPrintable(jsFilePath) << "'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue