Changeset 9ce8bc1


Ignore:
Timestamp:
Sep 8, 2012, 8:32:37 PM (13 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
5f07d50
Parents:
2e5dc1b
git-author:
Alex Dehnert <adehnert@…> (09/08/12 20:32:37)
git-committer:
Alex Dehnert <adehnert@…> (09/08/12 20:32:37)
Message:

Save error messages and narrow except clause

Apparently, we weren't bothering to actually *save* the GroupConstitution?
object at the right time consistently, which means that we were routinely
losing the error messages. This fixes that, and also ensures we only catch
IOErrors, since other things are likely the code's fault.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/models.py

    r8068f6d r9ce8bc1  
    145145            except IOError:
    146146                self.failure_date = now
     147                self.status_msg = "retrieval failed"
     148                self.failure_reason = self.status_msg
    147149                self.save()
    148150                success = False
    149                 self.status_msg = "retrieval failed"
    150                 self.failure_reason = self.status_msg
    151151                return (success, self.status_msg, old_success, )
    152152            if tmp_path == url:
     
    179179            self.status_msg = "no url"
    180180            self.failure_reason = self.status_msg
     181            self.save()
    181182        return (success, self.status_msg, old_success, )
    182183
     
    233234                stream = urllib.urlopen(self.source_url)
    234235                return stream.getcode()
    235             except:
     236            except IOError:
    236237                return "IOError"
    237238        else:
Note: See TracChangeset for help on using the changeset viewer.