Fix try/catch in internal paste with original data
The insert data call, which throws the exception, was accidentally
moved out of the try block.
Refactor so that only that call is inside the try block to avoid
future confusion, and to avoid surpressing other errors.
Also add a unit test.