XSharpPublic: Problem in _DbThrowErrorOnFailure()

When a problem occurs in a function like DBSkip() (in my case it happened probably due to corruption because of https://github.com/X-Sharp/XSharpPublic/issues/585), a runtime exception is thrown inside the code of _DbThrowErrorOnFailure(), when trying to use the result of DoError(). Problem can be reproduced with a DBSkip() with no open workarea:


FUNCTION Start() AS VOID
DbSkip()

System.InvalidCastException
Specified cast is not valid.

Callstack : 
static Boolean XSharp.RT.Functions._DbThrowErrorOnFailure(System.String funcName, System.Boolean resultToCheck)()   :  C:\xSharp\DevRt\Runtime\XSharp.RT\RDD\Dbfunctions.prg  :  36
static Boolean XSharp.RT.Functions.DbSkip(XSharp.__Usual[] Xs$Args)()   :  C:\xSharp\DevRt\Runtime\XSharp.RT\RDD\Db.prg  :  661
static System.Void xRuntime.Exe.Functions.Start()()   :  C:\VIDE\Projects\Project3\Applications\xRuntime\Prg\xRntime.prg  :  2

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (6 by maintainers)

Commits related to this issue

Most upvoted comments

OK, problem confirmed fixed. Also it’s actually easy enough to trap and throw the exception, with something like

ErrorBlock( { |e| DoThrow(e) } )

PROCEDURE DoThrow(oError AS Exception) THROW oError