handle `str_copy` failures