Skip to content

Commit

Permalink
Added error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamgutgutia committed Nov 18, 2023
1 parent ea79464 commit 784bac9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask import Flask
from flask import Flask, jsonify
from flask_cors import CORS
from dotenv import load_dotenv
import os
Expand All @@ -9,6 +9,10 @@
CORS(app)
app.config['MAX_CONTENT_LENGTH'] = 1024*1024*1024

@app.errorhandler(Exception)
def errorHandler(error):
return jsonify({"error":error}),500

app.register_blueprint(router)


Expand Down

0 comments on commit 784bac9

Please sign in to comment.