Skip to content

Instantly share code, notes, and snippets.

@timo
Created November 15, 2017 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timo/d60cefdbd100d097eec78663b5a97b26 to your computer and use it in GitHub Desktop.
Save timo/d60cefdbd100d097eec78663b5a97b26 to your computer and use it in GitHub Desktop.
write_fhb error message improvement
diff --git a/src/io/io.c b/src/io/io.c
index 5762f0666..be92c0af6 100644
--- a/src/io/io.c
+++ b/src/io/io.c
@@ -141,7 +141,7 @@ void MVM_io_write_bytes(MVMThreadContext *tc, MVMObject *oshandle, MVMObject *bu
MVM_exception_throw_adhoc(tc, "write_fhb requires a native array to read from");
if (((MVMArrayREPRData *)STABLE(buffer)->REPR_data)->slot_type != MVM_ARRAY_U8
&& ((MVMArrayREPRData *)STABLE(buffer)->REPR_data)->slot_type != MVM_ARRAY_I8)
- MVM_exception_throw_adhoc(tc, "write_fhb requires a native array of uint8 or int8");
+ MVM_exception_throw_adhoc(tc, "write_fhb requires a native array of uint8 or int8, but got %s", MVM_6model_get_debug_name(tc, buffer));
output = (char *)(((MVMArray *)buffer)->body.slots.i8 + ((MVMArray *)buffer)->body.start);
output_size = ((MVMArray *)buffer)->body.elems;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment