davanstrien HF staff commited on
Commit
f04a3dc
1 Parent(s): 4cc53b7

Add error handling to api_query_dataset function

Browse files
Files changed (1) hide show
  1. main.py +1 -1
main.py CHANGED
@@ -87,7 +87,7 @@ async def api_query_dataset(dataset_id: str, n: int = Query(default=10, ge=1, le
87
 
88
  except Exception as e:
89
  logger.error(f"Error querying dataset {dataset_id}: {str(e)}")
90
- raise HTTPException(status_code=500, detail=str(e))
91
 
92
 
93
  if __name__ == "__main__":
 
87
 
88
  except Exception as e:
89
  logger.error(f"Error querying dataset {dataset_id}: {str(e)}")
90
+ raise HTTPException(status_code=500, detail=str(e)) from e
91
 
92
 
93
  if __name__ == "__main__":