Error handling in Uniface
Author: roel.janszen@cal-consult.nl (rjanszen)
Hello Uniface developers, This is my first post in the forums. I would like to ask a question about error handling in Uniface. More specifically, how would error handling ideally look like. Most errors can be found in $procerror(context) after certain code executions, on which code can respond accordingly. But there may also be user-written functions and services, which can encounter errors (on a low level). How should one pass along (like 'throws' in C# for example) such errors. I understand that it's the programmers responsibility to handle expected errors in their code. What I am looking for however, is a solution which is as simple and generic as possible. For example, the many possible $procerror's (-1 to -1799) can, when encountered be returned back to a function or service's caller in the $status. Then one can always tell what errors have occurred, and many errors can always be handled in a similar fashion (logging, notification, etc.). What would be the most clean and effective solution in your opinion: Is there a golden standard? Thanks in advance, and kind regards, Roel

Regards, Knut



