diff options
author | Eduardo Julian | 2022-08-11 16:50:42 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-08-11 16:50:42 -0400 |
commit | e5625dd840a8b8adc76987f649da254335d3d93a (patch) | |
tree | fb672669383525d90d462edf8c141f98bc953894 /lux-python/source | |
parent | 065e8a4d8122d4616b570496915d2c0e2c78cd6b (diff) |
Improved exception-definition macro.
Diffstat (limited to 'lux-python/source')
-rw-r--r-- | lux-python/source/program.lux | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lux-python/source/program.lux b/lux-python/source/program.lux index 389e8251a..f3dbc436c 100644 --- a/lux-python/source/program.lux +++ b/lux-python/source/program.lux @@ -10,7 +10,7 @@ ["[0]" pipe] ["[0]" maybe] ["[0]" try (.only Try) (.use "[1]#[0]" monad)] - ["[0]" exception (.only exception)] + ["[0]" exception (.only Exception)] ["[0]" io (.only IO io)] ["[0]" function] [concurrency @@ -167,7 +167,8 @@ failure) {try.#Success output})))) - (exception (unknown_kind_of_object [object java/lang/Object]) + (exception.def (unknown_kind_of_object object) + (Exception java/lang/Object) (exception.report (list ["Object" (ffi.of_string (java/lang/Object::toString object))]))) @@ -374,7 +375,8 @@ (|>> (as java/lang/Object) (ffi.as org/python/core/PyFunction))) - (exception (cannot_apply_a_non_function [object java/lang/Object]) + (exception.def (cannot_apply_a_non_function object) + (Exception java/lang/Object) (exception.report (list ["Object" (ffi.of_string (java/lang/Object::toString object))] ["Class" (ffi.of_string (java/lang/Class::getName (java/lang/Object::getClass object)))]))) |