A little bit cryptic ...
error=$(exec 4>&1 5>&2 ; command goes here 2>&4 1>&5)
This swaps the function of stdout and stderr while command is running. So with:
error=$(exec 4>&1 5>&2 ; ls -l somefile not-there 2>&4 1>&5)
the ls -l for somefile is displayed and the error message regarding not-there is stored in the variable.
In your case, a simple cp command that does not write to stdout, you could more simply do:
error=$(cp this that 2>&1)