It's ok to set these three variables. It sets the "last error" state. In this way the error can be investigated, e.g. via postmortem debugging.