avoid using panic when order cancel failed

This commit is contained in:
c9s 2021-12-06 13:31:47 +08:00
parent 744af85a94
commit 634ce6180b

View File

@ -6,11 +6,9 @@ import (
"sync/atomic"
"time"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/c9s/bbgo/pkg/fixedpoint"
"github.com/c9s/bbgo/pkg/types"
"github.com/pkg/errors"
)
// DefaultFeeRate set the fee rate for most cases
@ -88,8 +86,6 @@ func (m *SimplePriceMatching) CancelOrder(o types.Order) (types.Order, error) {
}
if !found {
logrus.Panicf("cancel order failed, order %d not found: %+v", o.OrderID, o)
return o, fmt.Errorf("cancel order failed, order %d not found: %+v", o.OrderID, o)
}