#1946 Added exception types for except block in issue.py cause we were handeling the exceptions too generically.
Closed 7 years ago by pingou. Opened 7 years ago by smitthakkar96.
smitthakkar96/pagure issue_exception_types  into  master

file modified
+3 -3
@@ -322,7 +322,7 @@ 

              else:

                  # We assume datetime format, so validate it

                  try:

-                     updated_after= datetime.datetime.strptime(

+                     updated_after = datetime.datetime.strptime(

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

                  except ValueError:

                      raise pagure.exceptions.APIError(
@@ -413,7 +413,7 @@ 

      issue_id = issue_uid = None

      try:

          issue_id = int(issueid)

-     except:

+     except ValueError:

          issue_uid = issueid

  

      issue = pagure.lib.search_issues(
@@ -500,7 +500,7 @@ 

      issue_id = issue_uid = None

      try:

          issue_id = int(issueid)

-     except:

+     except ValueError:

          issue_uid = issueid

  

      issue = pagure.lib.search_issues(

file modified
+3 -3
@@ -176,7 +176,7 @@ 

          new_priority = None

          try:

              new_priority = int(form.priority.data)

-         except:

+         except ValueError:

              pass

          tags = [

              tag.strip()
@@ -187,7 +187,7 @@ 

          try:

              if repo.milestones:

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

-         except:

+         except ValueError:

              pass

  

          try:
@@ -611,7 +611,7 @@ 

  

      try:

          priority = int(priority)

-     except:

+     except ValueError:

          priority = None

  

      # Hide private tickets

no initial comment

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

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
7 years ago

The merge commit should be removed :)

1 new commit added

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

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

Thanks!

Pull-Request has been closed by pingou

7 years ago