Skip to content

Commit

Permalink
keygen: remove redundant error handler
Browse files Browse the repository at this point in the history
Fixing the following pylint warning:

    E0102[function-redefined]: handle_invalid_usage:
    function already defined line 132

We could rename one of the error handler functions, but we can IMHO
drop one of them and simply put multiple `@app.errorhandler`
decorators to one function.

Merges: #2251
  • Loading branch information
FrostyX authored and praiskup committed Jul 20, 2022
1 parent 58c0ed4 commit 47fa3cd
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions keygen/src/copr_keygen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,6 @@ def gen_key():


@app.errorhandler(500)
def handle_invalid_usage(error):
response = Response(error.msg, content_type="text/plain;charset=UTF-8")
response.status_code = error.status_code
response.data = str(error)
return response

@app.errorhandler(KeygenServiceBaseException)
def handle_invalid_usage(error):
response = Response(error.msg, content_type="text/plain;charset=UTF-8")
Expand Down

0 comments on commit 47fa3cd

Please sign in to comment.