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

Proposed 7 months ago by smitthakkar96
Modified 6 months ago
From forks/smitthakkar96/pagure issue_exception_types  into pagure master
file changed

@@ -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 changed

@@ -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

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

7 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 :)

7 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!

6 months ago

Pull-Request has been closed by pingou

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