OR-365 Correct error handling
Merge pull request #470 in OR/rse from ~MBAILLY/rse:OR-365-fix-error-message to master

* commit '07159a832e934a0b43c190611e2957552d3ba243':
  OR-365 Correct error handling