<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def process_request(self, req):
        ''' Checks to see if data returned from database is useable '''
        # Check status code of request
        req.raise_for_status() # if codes not in 200s; error raise
        # Proper status code, but check if server returned a warning
        try:
            output = req.json()
        except:
            exit(req.text) # server returned html error
        # Try to find an error msg in the server response
        try:
            error = output['data'].get('errormsg')
        except:
            error = output.get('errormsg') # server has 2 variations of errormsg
        finally:
            if error:
                exit(error)
            return output