I am working on adding Proparse to ABL2DB and am running into issues where Proparse is throwing an error. Using the code which I will show below, I have gotten this to where the process will complete and the error messages documenting the issues are put in the log, but I am still having the dialog box for the error come up and stop the processing. For what is conceptually a batch process, this is irritating. Is there a way that I can keep these .NET errors from throwing the dialog box?
method private void ProcessShared ( ipchCUID as character ): do on stop undo, retry: if retry then do: log-manager:write-message ("STOP condition encountered in BuildShared", "SYSERROR"). return. end. do on error undo, leave: obJavaFile = new java.io.File(chFullPath). obParseUnit = new ParseUnit(obJavaFile). obParseUnit:treeParser01(). TreeWalker(obParseUnit:getTopNode() ). BuildReferences( ipchCUID ). empty temp-table ttShared. catch eobAppError as Progress.Lang.AppError: log-manager:write-message ( eobAppError:ReturnValue ). delete object eobAppError. end catch. catch eobSysError as Progress.Lang.SysError : define variable inWhich as integer no-undo. log-manager:write-message(substitute("Unexpected Exception: &1", eobSysError:getMessage(1)), "SYSERROR"). if eobSysError:NumMessages > 1 then do inWhich = 2 to eobSysError:NumMessages: log-manager:write-message(substitute("Unexpected Exception (cont.): &1", eobSysError:getMessage(inWhich)), "SYSERROR"). end. do inWhich = 1 to num-entries(eobSysError:CallStack,"~n"): log-manager:write-message(entry(inWhich,eobSysError:CallStack,"~n"),"CALLSTACK"). end. delete object eobSysError no-error. end catch. end. /* do on error */ end. /* do on stop */ end method.
I am working on adding Proparse to ABL2DB and am running into issues where Proparse is throwing an error. Using the code which I will show below, I have gotten this to where the process will complete and the error messages documenting the issues are put in the log, but I am still having the dialog box for the error come up and stop the processing. For what is conceptually a batch process, this is irritating. Is there a way that I can keep these .NET errors from throwing the dialog box?
method private void ProcessShared (
ipchCUID as character
):
do on stop undo, retry:
if retry
then do:
log-manager:write-message ("STOP condition encountered in BuildShared", "SYSERROR").
return.
end.
do on error undo, leave:
obJavaFile = new java.io.File(chFullPath).
obParseUnit = new ParseUnit(obJavaFile).
obParseUnit:treeParser01().
TreeWalker(obParseUnit:getTopNode() ).
BuildReferences( ipchCUID ).
empty temp-table ttShared.
catch eobAppError as Progress.Lang.AppError:
log-manager:write-message ( eobAppError:ReturnValue ).
delete object eobAppError.
end catch.
catch eobSysError as Progress.Lang.SysError :
define variable inWhich as integer no-undo.
log-manager:write-message(substitute("Unexpected Exception: &1", eobSysError:getMessage(1)), "SYSERROR").
if eobSysError:NumMessages > 1
then do inWhich = 2 to eobSysError:NumMessages:
log-manager:write-message(substitute("Unexpected Exception (cont.): &1", eobSysError:getMessage(inWhich)), "SYSERROR").
end.
do inWhich = 1 to num-entries(eobSysError:CallStack,"~n"):
log-manager:write-message(entry(inWhich,eobSysError:CallStack,"~n"),"CALLSTACK").
end.
delete object eobSysError no-error.
end catch.
end. /* do on error */
end. /* do on stop */
end method.
Flag this post as spam/abuse.
I'll give that a try. Prior to this I hadn't tried anything with a .NET
aspect.
As a side note I will observe that some of what is bothering Proparse
are some very ugly things in the code. Part of the code base I am using
for testing dates back to the mid 1980s and I am being surprised at some
of what is lingering there! :)