test the return value of `copy` and throw an exception if false.