Skip to content

Commit

Permalink
chore: improve error message for fsevents failure
Browse files Browse the repository at this point in the history
Include the problematic event flags in the error message

Signed-off-by: Rudi Grinberg <[email protected]>

ps-id: 7ab84709-6af3-433e-b337-843610bd4119
  • Loading branch information
rgrinberg committed Oct 11, 2022
1 parent a757ad8 commit 2cbda58
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/fsevents/fsevents_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,12 @@ CAMLprim value dune_fsevents_action(value v_flags) {
} else if (flags & kFSEventStreamEventFlagItemModified) {
v_action = Val_int(3);
} else {
caml_failwith("fsevents: unexpected event action");
char* msg;
asprintf(&msg, "fsevents: unexpected event action %x", Int32_val(v_flags));
CAMLlocal1(v_msg);
v_msg = caml_copy_string(msg);
free(msg);
caml_failwith_value(v_msg);
}

CAMLreturn(v_action);
Expand Down

0 comments on commit 2cbda58

Please sign in to comment.