// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
//		¥ CreateErrorString
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
// To create the error string it first looks if the context record has an error string on it
// If so it uses that, if not it uses the UError class to generate the error code.
// If an error occurs a null string is returned and false is returned. If OK then true is returned and the string is filled
// out.
bool CAEDescException::CreateErrorString(
	Str255			outString) const
{
	outString[0]=0;
	
	Try_
	{
		StAEDescriptor		errorDesc(mContextRecord,keyErrorString,typeText);
	
		if (errorDesc.IsNotNull())
		{
			UExtractFromAEDesc::ThePString(errorDesc,outString);
			return true;
		}
		else
		{
			// No string, generate using context record
			return UErrors::GetErrorMessage(GetErrorCode(),mContextRecord,outString);
		}
	}
	Catch_(err)
	{
		return false;
	}
	
	return true;
}
Beispiel #2
0
void MyProcess::on_finished(int exitCode, QProcess::ExitStatus exitStatus) {
	// Checking exingStatus is not reliable under Windows where if the
	// process was terminated with TerminateProcess() from another
	// application its value is still NormalExit
	//
	// Checking exit code for a failing command is unreliable too, as
	// exmple 'git status' returns 1 also without errors.
	//
	// On Windows exit code seems reliable in case of a command wrapped
	// in Window shell interpreter.
	//
	// So to detect a failing command we check also if stderr is not empty.
	QString errorDesc(readAllStandardError());

	isErrorExit =   (exitStatus != QProcess::NormalExit)
	             || (exitCode != 0 && isWinShell)
	             || !errorDesc.isEmpty()
	             ||  canceling;

	if (!canceling) { // no more noise after cancel

		if (receiver)
			emit eof();

		if (isErrorExit)
			sendErrorMsg(false, errorDesc);
	}
	busy = false;
	if (async)
		deleteLater();
}
Beispiel #3
0
void QblZlib::errorMessage(int id)
{
    std::string errmsg;

    errmsg = "Error compress data";
    std::string errorNumber = std::to_string(id);
    std::string errorDesc(zError(id));
    throw QblException { errmsg, errorNumber, errorDesc };

    return;
}
Beispiel #4
0
void MyProcess::sendErrorMsg(bool notStarted, SCRef err) {
	if (!errorReportingEnabled)
		return;

	QString errorDesc(readAllStandardError());
	errorDesc.prepend(err);

	if (notStarted)
        errorDesc = QString::fromLatin1("Unable to start the process!");

	const QString cmd(arguments.join(" ")); // hide any QUOTE_CHAR or related stuff
	MainExecErrorEvent* e = new MainExecErrorEvent(cmd, errorDesc);
	QApplication::postEvent(guiObject, e);
}