コード例 #1
0
/*--------------------------------------------------------------------------*/
void callFunctionFromGateway(gw_generic_table *Tab, int sizeTab)
{
    if ( (Fin > sizeTab) || (Fin < 1) )
    {
        Scierror(999, _("Error: Not a valid primitive ID %d.\n"), Fin);
    }
    else
    {
#ifdef _MSC_VER
# ifndef _DEBUG
        _try
        {
            if (*(Tab[Fin - 1].f) != NULL)
            {
                (*(Tab[Fin - 1].f)) ((char*)Tab[Fin - 1].name, (unsigned long)strlen(Tab[Fin - 1].name));
            }
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {
            ExceptionMessage(GetExceptionCode(), (char*)Tab[Fin - 1].name);
        }
# else
        if (*(Tab[Fin - 1].f) != NULL)
        {
            (*(Tab[Fin - 1].f)) ((char*)Tab[Fin - 1].name, (unsigned long)strlen(Tab[Fin - 1].name));
        }
# endif
#else
        if (*(Tab[Fin - 1].f) != NULL)
        {
            (*(Tab[Fin - 1].f))((char *)Tab[Fin - 1].name, (unsigned long)strlen(Tab[Fin - 1].name));
        }
#endif
    }
}
コード例 #2
0
bool ModelExportStrategyRegistry::exportSelection(Selection* m, std::string filename){
	//validation
	if(m->getSelectedElements().size()==0)
		throw ExceptionMessage("Can't export selection with no selected elements.");
	std::string extension = FileUtils::getFileNameExtension(filename);
	ModelExportStrategy* exportStrategy = getRegistryByKeyInstance(extension);
	if(exportStrategy)
		return exportStrategy->exportSelection(m,filename);
	throw UnknownExtensionException(filename);
}
コード例 #3
0
Buffer & Inset::buffer()
{
	if (!buffer_) {
		odocstringstream s;
		string const iname = insetName(lyxCode());
		LYXERR0("Inset: " << this << " LyX Code: " << lyxCode()
					<< " name: " << iname);
		s << "LyX Code: " << lyxCode() << " name: " << iname;
		LATTEST(false);
		throw ExceptionMessage(BufferException, 
			from_ascii("Inset::buffer_ member not initialized!"), s.str());
	}
	return *buffer_;
}
コード例 #4
0
ファイル: Exceptions.cpp プロジェクト: skyformat99/Far-NetBox
bool ExceptionFullMessage(Exception * E, UnicodeString & Message)
{
  bool Result = ExceptionMessage(E, Message);
  if (Result)
  {
    Message += L"\n";
    ExtException * EE = dyn_cast<ExtException>(E);
    if ((EE != nullptr) && (EE->GetMoreMessages() != nullptr))
    {
      Message += EE->GetMoreMessages()->GetText() + L"\n";
    }
  }
  return Result;
}
コード例 #5
0
ファイル: Exceptions.cpp プロジェクト: skyformat99/Far-NetBox
TStrings * ExceptionToMoreMessages(Exception * E)
{
  TStrings * Result = nullptr;
  UnicodeString Message;
  if (ExceptionMessage(E, Message))
  {
    Result = new TStringList();
    Result->Add(Message);
    ExtException * ExtE = dyn_cast<ExtException>(E);
    if ((ExtE != nullptr) && (ExtE->GetMoreMessages() != nullptr))
    {
      Result->AddStrings(ExtE->GetMoreMessages());
    }
  }
  return Result;
}
コード例 #6
0
ファイル: Exceptions.cpp プロジェクト: gumb0/Far-NetBox
TStrings * ExceptionToMoreMessages(Exception * E)
{
  TStrings * Result = nullptr;
  UnicodeString Message;
  if (ExceptionMessage(E, Message))
  {
    Result = new TStringList();
    Result->Add(Message);
    ExtException * ExtE = NB_STATIC_DOWNCAST(ExtException, E);
    if ((ExtE != nullptr) && (ExtE->GetMoreMessages() != nullptr))
    {
      Result->AddStrings(ExtE->GetMoreMessages());
    }
  }
  return Result;
}
コード例 #7
0
ファイル: main.cpp プロジェクト: Mandar-Shinde/MiniLog
int main()
{
	Logger::system();

	try
	{
		throw ExceptionMessage();
	}
	catch (ExceptionMessage e)
	{
		Logger::err(e.what());
		Logger::info("\nthis is probably occurs when you do this, Try that in place of this");
		Logger::write("This is single file log writing");
	}

	return 0;
}
コード例 #8
0
ファイル: Exceptions.cpp プロジェクト: gumb0/Far-NetBox
UnicodeString GetExceptionHelpKeyword(const Exception * E)
{
  UnicodeString HelpKeyword;
  const ExtException * ExtE = NB_STATIC_DOWNCAST_CONST(ExtException, E);
  UnicodeString Message; // not used
  bool InternalError = false;
  if (ExtE != nullptr)
  {
    HelpKeyword = ExtE->GetHelpKeyword();
  }
  else if ((E != nullptr) && ExceptionMessage(E, false, false, Message, InternalError) &&
           InternalError)
  {
    HelpKeyword = HELP_INTERNAL_ERROR;
  }
  return HelpKeyword;
}
コード例 #9
0
ファイル: Exceptions.cpp プロジェクト: skyformat99/Far-NetBox
UnicodeString GetExceptionHelpKeyword(const Exception * E)
{
  UnicodeString HelpKeyword;
  const ExtException * ExtE = dyn_cast<ExtException>(E);
  UnicodeString Message; // not used
  bool InternalError = false;
  if (ExtE != nullptr)
  {
    HelpKeyword = ExtE->GetHelpKeyword();
  }
  else if ((E != nullptr) && ExceptionMessage(E, false, false, Message, InternalError) &&
           InternalError)
  {
#if defined(FARPLUGIN)
    HelpKeyword = HELP_INTERNAL_ERROR;
#endif // FARPLUGIN
  }
  return HelpKeyword;
}
コード例 #10
0
ファイル: InsetInfo.cpp プロジェクト: bsjung/Lyx
void InsetInfo::read(Lexer & lex)
{
	string token;
	while (lex.isOK()) {
		lex.next();
		token = lex.getString();
		if (token == "type") {
			lex.next();
			token = lex.getString();
			type_ = nameTranslator().find(token);
		} else if (token == "arg") {
			lex.next(true);
			name_ = lex.getString();
		} else if (token == "\\end_inset")
			break;
	}	
	if (token != "\\end_inset") {
		lex.printError("Missing \\end_inset at this point");
		throw ExceptionMessage(WarningException,
			_("Missing \\end_inset at this point."),
			from_utf8(token));
	}
	updateInfo();
}
コード例 #11
0
ファイル: modelexportstrategy.cpp プロジェクト: Gloix/Camaron
bool ModelExportStrategy::exportSelection(Selection*, std::string filename) throw(ExceptionMessage){
	throw ExceptionMessage("Can't export selection with extension: " +
						   FileUtils::getFileNameExtension(filename));
}
コード例 #12
0
ファイル: modelexportstrategy.cpp プロジェクト: Gloix/Camaron
bool ModelExportStrategy::exportModel(PolyhedronMesh*, std::string filename) throw(ExceptionMessage){
	throw ExceptionMessage("Can't export Polyhedron Mesh with extension: " +
						   FileUtils::getFileNameExtension(filename));
}
コード例 #13
0
ファイル: Exceptions.cpp プロジェクト: skyformat99/Far-NetBox
bool ExceptionMessageFormatted(const Exception * E, UnicodeString & Message)
{
  bool InternalError;
  return ExceptionMessage(E, true, true, Message, InternalError);
}