un-stopped bot return status "stopped" instead of the error

This commit is contained in:
2025-10-07 16:10:14 +07:00
parent f30cc7dc47
commit ff7e4ed3d3
3 changed files with 3 additions and 3 deletions

View File

@@ -277,7 +277,7 @@ public class LiveTradingBotGrain : Grain, ILiveTradingBotGrain, IRemindable
var hasOpenPositions = await HasOpenPositionsInDatabaseAsync();
if (hasOpenPositions)
{
_logger.LogWarning("Cannot stop strategy {Name} : strategy has open positions in database",
_logger.LogWarning("Stopping bot {Name} while it still has open positions in database. Trading loop will stop but positions remain managed by system.",
_tradingBot?.Config.Name);
throw new InvalidOperationException(
"Cannot stop bot while it has open positions. Please close all positions first.");

View File

@@ -60,7 +60,7 @@ namespace Managing.Application.ManageBot
catch (Exception e)
{
_tradingBotLogger.LogError(e, "Error stopping bot {Identifier}", identifier);
return BotStatus.Stopped;
throw;
}
}

View File

@@ -1767,7 +1767,7 @@ export class DataClient extends AuthorizedApiBase {
url_ = url_.replace(/[?&]$/, "");
let options_: RequestInit = {
method: "POST",
method: "GET",
headers: {
"Accept": "application/json"
}