#2643 sys::TestErr

SlimerDude Wed 27 Sep 2017

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 2017

I pushed a change to make it public

SlimerDude Mon 2 Oct 2017

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 2017

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.