[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: chasing the error...

  • Thread starter Thread starter marian.edu
  • Start date Start date
Status
Not open for further replies.
M

marian.edu

Guest
Laura, would you care to elaborate on the customer feedback that cause you to rollback the change a little bit? IMHO, fixing the doc on RETURN statement by adding a note that this works differently depending where it is used is clearly wrong. The language, even a forth generation one, need to be reasonable and predictable and having quirks like that one it doesn’t really help the developers to either learn it or be confident the statement actually do what it stands for. I might be wrong but for me ‘RETURN ERROR’ means exactly that, the block should return an error to whoever might have call it. I do, to some extent, understand the idea of the THROW addition since everyone else is using that - not so much the fact that it’s being hooked to the UNDO statement like it isn’t obvious for everyone when an error occurs the active transaction should be rolled back. However, that is no reason to make the RETURN statement be that confusing… at least the RETURN ERROR in a function (or method) block should raise an error at compile time because it clearly doesn’t do what any reasonable developer expect it to do. For me the RETURN ERROR should be just an alias for UNDO, THROW P.L.AppError that should be resolved by the compiler, as it is now the compiler doesn’t prove very helpful :( /* compiles, doesn’t throw */ function test returns integer (): return error. end. /* compile error - 2782 */ function testMessage returns integer (): return error ‘what?’. end. /* compiles, throws apperror */ method public integer test (): return error. end. /* compiles, throws apperror, return value is set */ method public integer tester (): return error ‘what?’. end. Again, it might be just me but somehow all this doesn’t really compute in my head :( Marian Edu Acorn IT www.acorn-it.com www.akera.io +40 740 036 212

Continue reading...
 
Status
Not open for further replies.
Back
Top