diff options
| author | ced <> | 2007-09-20 08:49:02 +0000 |
|---|---|---|
| committer | ced <> | 2007-09-20 08:49:02 +0000 |
| commit | 6f7bdabe0ad4c61fdfc993d52a63c2ee0db75f38 (patch) | |
| tree | a030fa005770ec988715c6b50c6428640c57514e /bin/addons/base/module/module.py | |
| parent | 8850fa66f4baa790a68175058fc5d5a90cc2b4e5 (diff) | |
Add exception if the user provide a bad url
bzr revid: ced-86d62f683f3aad3e1654c0e89b4eccdc09b9cfbe
Diffstat (limited to 'bin/addons/base/module/module.py')
| -rw-r--r-- | bin/addons/base/module/module.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index 1772af738f2..9b3fa23e45f 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -405,7 +405,15 @@ class module(osv.osv): self._update_category(cr, uid, id, terp.get('category', 'Uncategorized')) for repository in robj.browse(cr, uid, robj.search(cr, uid, [])): - index_page = urllib.urlopen(repository.url).read() + try: + index_page = urllib.urlopen(repository.url).read() + except IOError, e: + if e.errno == 21: + raise orm.except_orm('Error', + 'This url \'%s\' must provide an html file ' + 'with links to zip modules' % (repository.url)) + else: + raise modules = re.findall(repository.filter, index_page, re.I+re.M) mod_sort = {} for m in modules: |
