Skip to content

Commit 740f8ed

Browse files
authored
Merge pull request #657 from OpenKnowledgeMaps/fix-api-errorhandling
Fix api errorhandling
2 parents c1dd0f6 + 4ae0493 commit 740f8ed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

server/workers/api/src/apis/export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def post(self, format):
143143
headers)
144144
except Exception as e:
145145
export_ns.logger.error(e)
146-
result = {'success': False, 'reason': e}
146+
result = {'success': False, 'reason': str(e)}
147147
headers = {'ContentType': 'application/json'}
148148
return make_response(jsonify(result),
149149
500,

server/workers/persistence/src/apis/persistence.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def post(self, database):
197197
200,
198198
headers)
199199
except Exception as e:
200-
result = {'success': False, 'reason': e}
200+
result = {'success': False, 'reason': str(e)}
201201
headers = {'ContentType': 'application/json'}
202202
return make_response(jsonify(result),
203203
500,
@@ -220,7 +220,7 @@ def post(self, database):
220220
headers = {'ContentType': 'application/json'}
221221
return make_response(jsonify(result), 200, headers)
222222
except Exception as e:
223-
result = {'success': False, 'reason': e}
223+
result = {'success': False, 'reason': str(e)}
224224
headers = {'ContentType': 'application/json'}
225225
return make_response(jsonify(result), 500, headers)
226226

@@ -313,7 +313,7 @@ def post(self, database):
313313
headers["Content-Type"] = "application/json"
314314
return make_response(jsonify(result), 200, headers)
315315
except Exception as e:
316-
result = {'success': False, 'reason': e}
316+
result = {'success': False, 'reason': str(e)}
317317
headers = {'ContentType': 'application/json'}
318318
return make_response(jsonify(result), 500, headers)
319319

0 commit comments

Comments
 (0)