Commit 108d04aa authored by Juan Felipe Mosquera Morales's avatar Juan Felipe Mosquera Morales
Browse files

fix to display proper error msg from db

parent f2bb5fe1
......@@ -347,7 +347,7 @@ class ChemblModelResource(ModelResource):
# ----------------------------------------------------------------------------------------------------------------------
def _handle_database_error(self, error, request, kwargs):
msg = str(error.message)
msg = str(error)
if 'MDL-1622' in msg:
raise BadRequest("Input string %s is not a valid SMILES string" % kwargs.get('smiles'))
if 'MDL-2063' in msg:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment