in connectors/sources/network_drive.py [0:0]
def handle_smb_response_errors(self, exception):
msg = ""
if exception.status == STATUS_INVALID_WORKSTATION:
msg = f"Client does not have permission to access server: ({self.server_ip}:{self.port})."
self._logger.debug(msg=msg)
raise ClientPermissionException(msg) from exception
elif exception.status == STATUS_PASSWORD_MUST_CHANGE:
msg = f"The password for User: {self.username} must be changed before logging on for the first time."
self._logger.debug(msg=msg)
raise PasswordChangeRequiredException(msg) from exception
elif exception.status == STATUS_NO_LOGON_SERVERS:
msg = f"No logon servers available for connecting to server: ({self.server_ip}:{self.port})."
self._logger.debug(msg=msg)
raise NoLogonServerException(msg) from exception
elif exception.status == STATUS_ACCOUNT_DISABLED:
msg = f"Account with Username: {self.username} is disabled."
self._logger.debug(msg=msg)
raise UserAccountDisabledException(msg) from exception
elif exception.status == STATUS_INVALID_LOGON_HOURS:
msg = (
f"User: {self.username} cannot logon outside the specified logon hours."
)
self._logger.debug(msg=msg)
raise InvalidLogonHoursException(msg) from exception
else:
self._logger.debug(
f"Error occurred while creating SMB session. Error: {exception}"
)
raise