Refactoring: exchanging 'error' arguments by 'errorCode' arguments