venerdì 12 febbraio 2016

HOWTO: Get error details from INFOLOG by code

You can use this code for getting che last error from INFO LOG.
I tested this code in all situations, using prefix and other conditions, and it works fine.
In the past i found some other scripts to do that, but i some situations does not work.

int i;
container infoLogCon;
container infoLogItem;
Exception infoLogItemExceptionType;
str infoLogItemMessage;
str strInfoLogMessage;
;
try
{
 infologCon = infolog.copy(1, infolog.line());
 for(i = infolog.line() + 1; i > 1; i--)
 {
  infoLogItem = conpeek(infologCon, i);
  infoLogItemExceptionType = conpeek(infoLogItem, 1);
  infoLogItemMessage = conpeek(infoLogItem, 2);
  if (infoLogItemExceptionType == Exception::Error)
  {
   strInfoLogMessage = infoLogItemMessage;
   strInfoLogMessage = strreplace(strInfoLogMessage, '\t', ' - ');
   break;
  }
 }
 if (!strInfoLogMessage)
  strInfoLogMessage = "Errore non definito";
}
catch
{
 strInfoLogMessage = "Errore sconosciuto";
}
strInfoLogMessage = strltrim(strrtrim(strInfoLogMessage));

Nessun commento:

Posta un commento

AX 2012: The request was aborted: Could not create SSL/TLS secure channel

The error you're encountering, "The request was aborted: Could not create SSL/TLS secure channel," can occur due to various re...