Skip to content

Commit

Permalink
deps: Make error message more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Nov 17, 2024
1 parent e3c15d3 commit ac3f268
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/bsys/bob/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,19 +256,16 @@ static int deps(void) {
flamingo_val_t* const val = vec->val->vec.elems[i];

if (val->kind != FLAMINGO_VAL_KIND_INST) {
goto uh_oh;
LOG_FATAL("Dependencies vector element must be a instance of the 'Dep' class.");
return -1;
}

flamingo_val_t* const class = val->inst.class;

if (flamingo_cstrcmp(class->name, "Dep", class->name_size) != 0) {
goto uh_oh;
LOG_FATAL("Dependencies vector element must be a instance of the 'Dep' class (not '%.*s').", (int) class->name_size, class->name);
return -1;
}

uh_oh:

LOG_FATAL("Dependencies vector element must be a instance of the `Dep` class.");
return -1;
}

return deps_download(vec->val);
Expand Down

0 comments on commit ac3f268

Please sign in to comment.