PR#1946 Closed Added exception types for except block in issue.py cause we were handeling the exceptions too generically.

Proposed 5 months ago by smitthakkar96
Modified 4 months ago
From forks/smitthakkar96/pagure issue_exception_types  into pagure master
file changed

 1 @@ -322,7 +322,7 @@ 

 2               else:

 3                   # We assume datetime format, so validate it

 4                   try:

 5 -                     updated_after= datetime.datetime.strptime(

 6 +                     updated_after = datetime.datetime.strptime(

 7                           since, '%Y-%m-%d')

 8                   except ValueError:

 9                       raise pagure.exceptions.APIError(

10 @@ -413,7 +413,7 @@

11       issue_id = issue_uid = None

12       try:

13           issue_id = int(issueid)

14 -     except:

15 +     except ValueError:

16           issue_uid = issueid

17   

18       issue = pagure.lib.search_issues(

19 @@ -500,7 +500,7 @@

20       issue_id = issue_uid = None

21       try:

22           issue_id = int(issueid)

23 -     except:

24 +     except ValueError:

25           issue_uid = issueid

26   

27       issue = pagure.lib.search_issues(
file changed

 1 @@ -176,7 +176,7 @@ 

 2           new_priority = None

 3           try:

 4               new_priority = int(form.priority.data)

 5 -         except:

 6 +         except ValueError:

 7               pass

 8           tags = [

 9               tag.strip()

10 @@ -187,7 +187,7 @@

11           try:

12               if repo.milestones:

13                   new_milestone = form.milestone.data.strip() or None

14 -         except:

15 +         except ValueError:

16               pass

17   

18           try:

19 @@ -611,7 +611,7 @@

20   

21       try:

22           priority = int(priority)

23 -     except:

24 +     except ValueError:

25           priority = None

26   

27       # Hide private tickets

Here as well, one of the two commit message needs to be reworded

5 months ago

3 new commits added

  • in ui/issues.py the exceptions were handeled too generically so add
  • Addded exception types where we were handling exceptions in a too
  • Merge branch 'master' of ssh://pagure.io/pagure

The merge commit should be removed :)

5 months ago

1 new commit added

  • Revert "Merge branch 'master' of ssh://pagure.io/pagure"

I'm going to close this PR, please reopen it when your changes are ready to be reviewed :)

Thanks!

4 months ago

Pull-Request has been closed by pingou

Changes summary
+3 -3
file changed
+3 -3
file changed