<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete(self, cls, rid, user='undefined'):
 """ Delete a record by id. `user` currently unused. Would be used with soft deletes. 1 0 Traceback (most recent call last):
 KeyError: 'No record tstoretest/1' """

        self.validate_record_type(cls)
        deletedcount = self.db.delete(cls, {ID: rid})
        if deletedcount < 1:
            raise KeyError('No record {}/{}'.format(cls, rid))