<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_javascript_error(self, return_type='string'):
 """Return the gathered javascript error Args: return_type: 'string' | 'list'; default: 'string' """


        if BROME_CONFIG['proxy_driver']['intercept_javascript_error']:
            js_errors = self._driver.execute_script(
                'return window.jsErrors; window.jsErrors = [];'
            )

            if not js_errors:
                js_errors = []

            if return_type == 'list':
                if len(js_errors):
                    return js_errors
                else:
                    return []
            else:
                if len(js_errors):
                    return os.linesep.join(js_errors)
                else:
                    return self.no_javascript_error_string
        else:
            if return_type == 'list':
                return []
            else:
                return self.no_javascript_error_string