add error manazge parse chaine
This commit is contained in:
parent
98862ad0eb
commit
2291fb2dfa
@ -44,6 +44,7 @@ class JSONfile:
|
||||
self.data=liste_chaine
|
||||
with open(self.datafilepath, 'w', encoding='utf-8') as f:
|
||||
json.dump(liste_chaine, f, indent=4)
|
||||
return "ok"
|
||||
def __repr__(self):
|
||||
return str(self.data)
|
||||
|
||||
|
@ -19,8 +19,11 @@ def get_chaine(num):
|
||||
|
||||
@app.route('/api/v1/chaine/', methods=['put'])
|
||||
def update_list():
|
||||
data.parsechaine()
|
||||
return jsonify("OK")
|
||||
status="data.parsechaine()"
|
||||
if(status=='ok'):
|
||||
return jsonify("OK")
|
||||
else:
|
||||
return make_response('Error during Chaine Update',500)
|
||||
|
||||
@app.route('/api/v1/chaine/<num>/emission', methods=['GET'])
|
||||
def get_emmission(num):
|
||||
|
Loading…
Reference in New Issue
Block a user