Closed flbulgarelli closed 8 years ago
Yes, there is a method in Object class for that.
https://github.com/uqbar-project/wollok/blob/master/org.uqbar.project.wollok.lib/src/wollok.wlk
method error(message) { throw new Exception(message) }
On Wed, Jun 8, 2016 at 4:57 AM, Franco Leonardo Bulgarelli < notifications@github.com> wrote:
When teaching about exceptions, I want to avoid talking about exception classes and exception objects head-first, at least until the bubbling mechanism has being understood.
I'd like to have a language feature, or simply a method in object that allows you to raise an Exception given a message, similar to what assert.fail does. For example:
raise("not enough energy!")
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/uqbar-project/wollok/issues/694, or mute the thread https://github.com/notifications/unsubscribe/AEORWOdA75ieFxxL0iJhDtEre_wFN19Bks5qJi-kgaJpZM4IwjN_ .
Nice. Closing
Hm, wait.
It is not behaving exactly as expected. I will open a different ticket for it
When teaching about exceptions, I want to avoid talking about exception classes and exception objects head-first, at least until the bubbling mechanism has being understood.
I'd like to have a language feature, or simply a method in
object
that allows you to raise anException
given a message, similar to whatassert.fail
does. For example: