#2643 sys::TestErr

SlimerDude Wed 27 Sep

Could the class sys::TestErr be made public?

Testing frameworks such as xfant and Fancordion often need to catch TestErr for reporting purposes. But at the moment, a general catch all needs to be put in place and reflection used to ascertain the Err type.

brian Wed 27 Sep

I pushed a change to make it public

SlimerDude Mon 2 Oct

Thanks Brian.

Though I made an assumption that as TestErr was internal, it couldn't be referenced or caught... but it seems the following compiles just fine in Fantom 1.0.69:

try { null?.toStr } 
catch (TestErr err) { /* note TestErr is internal */ }

but this still throws an compilation error:

a := TestErr("Boom!")

Could it be that internal scope isn't checked when catching Errs?

brian Wed 4 Oct

Could it be that internal scope isn't checked when catching Errs?

Yes that was missing, good catch (pun intended)! I pushed a fix for that

Login or Signup to reply.