Subclassing Error

This forum is meant for questions and discussions about the X# language and tools
Post Reply
stefan.ungemach
Posts: 71
Joined: Thu Jul 15, 2021 10:46 am
Location: Germany

Subclassing Error

Post by stefan.ungemach »

Does anyone have an idea why even a very simple instantiation of an Error subclass crashes in my code?

class ADSError inherit Error
method @@Throw() as void pascal
local oCB as Codeblock
safedebout32( self:SubCode, self:FuncSym, self:CallFuncSym )
if !empty( errorblock() ) // ACCEPT22 nur TEST auf Errorblock
oCB := suspenderrorhandler(NULL_CODEBLOCK)
begin sequence
super:@@Throw()
recover
end sequence
reseterrorhandler( oCB )
endif
oCB := NULL_CODEBLOCK
return
END CLASS
function ADSErrorBildenAusFehlercode(dwErrorCode as dWord, cFunc as string, cCallFunc as string, cExtraInfo := "" as string) as ADSError pascal

local oError as ADSError
oError := ADSError{}
User avatar
Chris
Posts: 4599
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Subclassing Error

Post by Chris »

Hi Stefan,

There's a lot of unknown things in the sample you posted, can you please a compilable sample showing the problem?
Also in which line does the crash happen? Isn't there an exception message shown?

.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
stefan.ungemach
Posts: 71
Joined: Thu Jul 15, 2021 10:46 am
Location: Germany

Subclassing Error

Post by stefan.ungemach »

I'm sorry, but it seems to be an error in my callstack. If I write a 5-Liner it works; looks like it does in my code as well but logs a misleading call stack on the debug console. Please close the case.
Post Reply