Raise proper error on strategy search

part of https://github.com/freqtrade/frequi/issues/1387
This commit is contained in:
Matthias
2023-07-27 07:03:35 +02:00
parent bbf472e69b
commit d638a4a0ff

View File

@@ -315,7 +315,8 @@ def get_strategy(strategy: str, config=Depends(get_config)):
extra_dir=config_.get('strategy_path'))
except OperationalException:
raise HTTPException(status_code=404, detail='Strategy not found')
except Exception as e:
raise HTTPException(status_code=502, detail=str(e))
return {
'strategy': strategy_obj.get_strategy_name(),
'code': strategy_obj.__source__,