If I understand the situation correctly, you need to catch the error and place information from that error to variables which you then again pass to the procedure (or use the values directly).
For example you now try to pass ERROR_NUMBER to the procedure, but it isn't a variable or a function. Try for example using ERROR_NUMBER() instead. In other words,
...
@UserId = @UserId,
@ErrorNumber = ERROR_NUMBER(),
...