diff options
author | Andy Wingo <wingo@pobox.com> | 2009-08-20 12:46:36 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-08-20 18:52:50 +0200 |
commit | 7ea9a0a764f7219deb4eb3bd85b60e9d8368aca5 (patch) | |
tree | b5d805af3cbeaf652811a5b4719dd5476f72aa09 | |
parent | 8274228f79ac2b2371b83d0e88b648c18d2e6103 (diff) | |
download | guile-7ea9a0a764f7219deb4eb3bd85b60e9d8368aca5.tar.gz |
better VM error messages
* libguile/vm-engine.c: Attempt to make error messages more friendly
and uniform with historical expectation.
-rw-r--r-- | libguile/vm-engine.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index 480a8cb03..32780b87a 100644 --- a/libguile/vm-engine.c +++ b/libguile/vm-engine.c @@ -158,12 +158,12 @@ VM_NAME (struct scm_vm *vp, SCM program, SCM *argv, int nargs) SCM err_msg; vm_error_bad_instruction: - err_msg = scm_from_locale_string ("VM: Bad instruction: ~A"); + err_msg = scm_from_locale_string ("VM: Bad instruction: ~s"); finish_args = scm_list_1 (scm_from_uchar (ip[-1])); goto vm_error; vm_error_unbound: - err_msg = scm_from_locale_string ("VM: Unbound variable: ~A"); + err_msg = scm_from_locale_string ("VM: Unbound variable: ~s"); goto vm_error; vm_error_wrong_type_arg: @@ -184,10 +184,9 @@ VM_NAME (struct scm_vm *vp, SCM program, SCM *argv, int nargs) goto vm_error; vm_error_wrong_type_apply: - err_msg = scm_from_locale_string ("VM: Wrong type to apply: ~S " - "[IP offset: ~a]"); - finish_args = scm_list_2 (program, - SCM_I_MAKINUM (ip - bp->base)); + SYNC_ALL (); + scm_error (scm_misc_error_key, FUNC_NAME, "Wrong type to apply: ~S", + scm_list_1 (program), SCM_BOOL_F); goto vm_error; vm_error_stack_overflow: @@ -201,7 +200,7 @@ VM_NAME (struct scm_vm *vp, SCM program, SCM *argv, int nargs) goto vm_error; vm_error_improper_list: - err_msg = scm_from_locale_string ("VM: Attempt to unroll an improper list: tail is ~A"); + err_msg = scm_from_locale_string ("Expected a proper list, but got object with tail ~s"); goto vm_error; vm_error_not_a_pair: @@ -217,12 +216,12 @@ VM_NAME (struct scm_vm *vp, SCM program, SCM *argv, int nargs) goto vm_error; vm_error_no_values: - err_msg = scm_from_locale_string ("VM: 0-valued return"); + err_msg = scm_from_locale_string ("Zero values returned to single-valued continuation"); finish_args = SCM_EOL; goto vm_error; vm_error_not_enough_values: - err_msg = scm_from_locale_string ("VM: Not enough values for mv-bind"); + err_msg = scm_from_locale_string ("Too few values returned to continuation"); finish_args = SCM_EOL; goto vm_error; |