Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tiesmaster/1067029 to your computer and use it in GitHub Desktop.
Save tiesmaster/1067029 to your computer and use it in GitHub Desktop.
build_magik_image() doesn't notify its caller on a failing load_code_proc()
_block
_global build_failed
build_failed << _false
magik_image.register_new("test",
:image_file_name, "test",
:load_modules, :non_existing_module,
:load_code_proc,
_proc(mi)
_try
_with cond
mi.sys!perform(:load_code|()|, mi)
_when error
_global build_failed
build_failed << _true
write("**** Error: load_code() failed")
cond.continue_handling()
_endtry
_endproc
)
_local ret << build_magik_image("test")
write("build failed?: ", build_failed)
_endblock
$
_block
magik_image.register_new("test",
:image_file_name, "test",
:load_modules, :non_existing_module
)
_try
_local ret << build_magik_image("test")
_if ret _is _unset
_then
write("[FAIL] expected a return code, or a condition. Neither happened.")
_elif ret > 0
_then
write("[INFO] build_magik_image() failed, return code > 0, as expected")
_endif
_when error
write("[INFO] build_magik_image() failed with a condition, that's what we want")
_endtry
_endblock
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment