#969 frontend: fixes traceback with invalid chroot name
Merged 4 years ago by praiskup. Opened 4 years ago by thrnciar.
copr/ thrnciar/copr traceback-not-valid-chroot-name  into  master

@@ -89,7 +89,7 @@ 

  from coprs.views.rss_ns import rss_ns

  from coprs.views.rss_ns import rss_general

  

- from coprs.exceptions import ObjectNotFound, AccessRestricted, BadRequest, CoprHttpException

+ from coprs.exceptions import ObjectNotFound, AccessRestricted, BadRequest, CoprHttpException, MalformedArgumentException

  from .context_processors import include_banner, inject_fedmenu, counter_processor

  

  setup_log()
@@ -135,6 +135,7 @@ 

  

  @app.errorhandler(400)

  @app.errorhandler(BadRequest)

+ @app.errorhandler(MalformedArgumentException)

  def handle_400(error):

      error_handler = get_error_handler()

      return error_handler.handle_400(error)

@@ -855,8 +855,7 @@ 

              valid = True

  

          if not valid:

-             raise MalformedArgumentException(

-                 "Chroot name is not valid")

+             raise MalformedArgumentException("Chroot identification is not valid")

  

          if noarch and len(split_name) == 2:

              split_name.append(None)

Could we somehow return 400 Bad Request, instead of 404 Not Found or 500 ...?

rebased onto 67a85edd08da562fd30b50d4676699de5a63d918

4 years ago

rebased onto a9022b211738484c7540af0b6893b5ca18ec9ccb

4 years ago

I rather mean to handle the MalformedArgumentException as 400 ...

rebased onto 0db1380b1e6ed4c1d5797123efbfc3b544c578cc

4 years ago

rebased onto 8cb4de1054656c4f3339a40d380b5b8a0f4cf2b9

4 years ago

rebased onto bcb8c4c0d1f1f45ca1d8cdee8d59ad391af80be2

4 years ago

rebased onto 0e7ea75a69a1d760b70e31791bc5f7f6a267b8b8

4 years ago

this looks good to me, but I'd like to hear @frostyx's opinion here

Also please rebase, the Frontend CI should be fixed in the latest master.

rebased onto d5fea3b4b617dc6ec1edbfae1be2e4d15000ab59

4 years ago

rebased onto 703d65a780c6732e803f1be5446232863c2a7f20

4 years ago

rebased onto eecc19556e5ec5b8f414e6b63c404c08e8d6584b

4 years ago

rebased onto bae2964

4 years ago

Pull-Request has been merged by praiskup

4 years ago