Consultor Eletrônico



Kbase P146265: Run time error 12869 is not caught by catch block
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/14/2009
Status: Unverified

SYMPTOM(s):

Run time error 12869 is not caught by catch block

Invalid cast from <name> to <name>. (12869)

Invalid cast from Progress.Data.BindingSource to System.Windows.Form.Control. (12869)


FACT(s) (Environment):

The method that is called uses the dynamic-cast function
The method has a catch block to trap any runtime errors that occur during the execution of the dynamic-cast function
method public logical isDescendantOf(input prObject as Progress.Lang.Object, input pcAncestorType as character):
return validObject(dynamic-cast(prObject,pcAncestorType)).
catch systemError as Progress.Lang.SysError:
return false.
end catch.
end method.


Windows
OpenEdge 10.2A

CAUSE:

Bug# OE00184396


FIX:

There are two possible workarounds:

1) Since the error is produced after the call to the method, it can be caught by adding a catch block when it is called. For example:

do while valid-object(reference) on error undo,throw:
if isDescendantOf(reference,"System.Windows.Forms.Control") then do:
message reference ': it worked' view-as alert-box.
end.
reference = reference:next-sibling.
catch sysError as progress.Lang.SysError:
end catch.
end.

2). The error is handled in the isDescendantOf method.

method public logical isDescendantOf(input prObject as Progress.Lang.Object, input pcAncestorType as character):
define variable baseObject as class Progress.Lang.Object no-undo.
baseObject = dynamic-cast(prObject,pcAncestorType) no-error.
return validObject(baseObject).
end method.