<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wait(self):
 """ Wait for the request to finish and return the result or error when finished :returns: result or error :type: result tyoe or Error """

        self.thread.join()
        if self.error is not None:
            return self.error
        return self.result