Throw an exception if copying a object doesn't work