def error(self, offense, comment=None):
        '''
        wrap Exception so that user better sees what happened where.
        '''

        packagedInfo=['\n---------------------']
        if comment:
            packagedInfo.append(comment)
        packagedInfo.append("Offensive statement or expression: %s" % offense)
        packagedInfo.append('Underlying exception:')
        packagedInfo.append(format_exc().splitlines()[-1])

        # annotate with the proper source line
        stmt, src, num = self.lines[self.currentLine]
        packagedInfo.append("\nSource line: %s \nLine number: %d\nSource file: %s" % (stmt.strip(), num+1, src) )

        if self.verboseErrors and hasattr(self, 'globals'):
            packagedInfo.append('Variables available when exception occured:')

            globs = self.globals.copy()
            # remove confusing things from the namespace...
            globs.pop('__builtins__', None)
            globs.pop('_mergeBlock__', None)
            globs.pop('_resolveSimple__', None)

            items = globs.items()
            items.sort()

            def printNice(item, indent=20):
                from pprint import pformat
                out = []
                fill = ' ' * indent

                k,v = item
                dataList = pformat(v).split('\n')
                out=[]
                out.append(k.ljust(indent) + dataList.pop(0))
                for l in dataList:
                    out.append(fill + l)
                return '\n'.join(out)

            for it in items:
                packagedInfo.append('' + printNice(it))

        packagedInfo.append('---------------------')

        raise YaptooError, '\n'.join(packagedInfo)

        wrap Exception so that user better sees what happened where.
        
recipes/Python/465508_Yaptoo_Yaptu_outrageously_obfuscated__or_yet/recipe-465508.py