Ejemplo n.º 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
    }
}
Ejemplo n.º 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);
}
Ejemplo n.º 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_;
}
Ejemplo n.º 4
0
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;
}
Ejemplo n.º 5
0
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;
}
Ejemplo n.º 6
0
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;
}
Ejemplo n.º 7
0
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;
}
Ejemplo n.º 8
0
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;
}
Ejemplo n.º 9
0
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;
}
Ejemplo n.º 10
0
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();
}
Ejemplo n.º 11
0
bool ModelExportStrategy::exportSelection(Selection*, std::string filename) throw(ExceptionMessage){
	throw ExceptionMessage("Can't export selection with extension: " +
						   FileUtils::getFileNameExtension(filename));
}
Ejemplo n.º 12
0
bool ModelExportStrategy::exportModel(PolyhedronMesh*, std::string filename) throw(ExceptionMessage){
	throw ExceptionMessage("Can't export Polyhedron Mesh with extension: " +
						   FileUtils::getFileNameExtension(filename));
}
Ejemplo n.º 13
0
bool ExceptionMessageFormatted(const Exception * E, UnicodeString & Message)
{
  bool InternalError;
  return ExceptionMessage(E, true, true, Message, InternalError);
}