better error reporting wrapper at the toplevel