> Such a shame macros are a pain to import. Do you think a simple function would be better then?

I think it would. This function will only be called in one place so I don't think it will be heard to isolate the error. Just make sure the error message that is printed is very verbose.