diff --git a/app/main.py b/app/main.py index 5a4eb85..94ce7ae 100644 --- a/app/main.py +++ b/app/main.py @@ -336,8 +336,7 @@ def health(): # API for updating domain's IP @app.route('/update', methods=["GET"]) def update_addr(): -# try: - if True: + try: if 'domain' not in request.args: return jsonify({"status": "400", "code": "domain-error", "comment": "Missing or invalid domain"}), 400 domain = request.args['domain'] @@ -368,9 +367,9 @@ def update_addr(): return jsonify({"status": "500", "code": "internal-server-error", "comment": "An error occurred while processing request"}), 500 return jsonify({"status": "200", "code": "ok", "comment": "Updated successfully"}) -# except Exception as e: -# print(e, flush=True) -# return jsonify({"status": "500", "code": "internal-server-error", "comment": "An error occurred while processing request"}), 500 + except Exception as e: + print(e, flush=True) + return jsonify({"status": "500", "code": "internal-server-error", "comment": "An error occurred while processing request"}), 500 if __name__ == '__main__':