Smart Error Handling
During this coding stage besides working on converting and updating rules (you can read more here), I have also been working on handling exceptions in Renraku. Seeing as rules can be created by anyone and can have some bugs, you can get a lot of exception errors when you click on a method. Previously, you could enter a mode where you would ignore all the errors whatsoever, which isn’t nice because sometimes users might not know that there is a problem. But thanks to this update it will be now possible to see all the exceptions in the QA bar, without being interrupted. This will be useful for both experienced developers, who often have to break certain methods while working, and for relatively new Pharo users, for whom this approach will be less overwhelming than being constantly interrupted by really annoying exception messages.
The thing is, Renraku is an incredibly powerful tool, with the help of which you can implement many useful things. For example, Renraku can be used not only for reporting critiques, but also for reporting issues via the Pharo issue tracker. Thus I programmed ReExceptionProperty, which is a subclass of ReProperty that is shown in the QA bar. ExceptionProperty saves the message of an exception to display it as a property headline. It also saves the stack, through which you can debug the exception if needed. All you need is to click on the bug icon on the exception message to start the debugging process. So now the user can work without interruptions (because they can be extremely annoying if you are working in a developer’s mode and constantly experimenting on something), but at the same time the user is alerted to the exceptions that occured.
Next I worked on error handling during checking in the ReCriticEngine class—in this case I added the on:do: part for processing the exception, which is basically like try-catch in other programming languages.

And finally I worked on setting exceptions in preferences through ReExceptionStrategy. There are three strategies. One — ReIgnoreExceptionStrategy — in accordance with its name, ignores the exception whatsoever and continues the execution. The second one is RePassExceptionStrategy, which passes the exception on, allowing handlers up the stack to deal with it, or opens the debugger if there are no handlers. And the last one, ReLogExceptionStrategy, — reports an exception as a property (critique) which can be debuged afterwards. Here’s the code for it:

And this is about it about the error handling. It took quite a lot of time to work on it, and probably the same amount to write a more or less comprehensive blog post about it, but here we are. I did my best to take the existing issues with the exceptions into account, and this update should be quite useful for everyone.
— M
