@@ -460,7 +460,7 @@ protected override async Task<ExchangeOrderResult> OnPlaceOrderAsync(ExchangeOrd
460
460
}
461
461
catch ( Exception ex ) // All fails come back with an exception.
462
462
{
463
- Logger . Error ( ex , "Failed to place coinbase error " ) ;
463
+ Logger . Error ( ex , "Failed to place coinbase order " ) ;
464
464
var token = JToken . Parse ( ex . Message ) ;
465
465
return new ExchangeOrderResult ( ) {
466
466
Result = ExchangeAPIOrderResult . Rejected ,
@@ -479,9 +479,14 @@ protected override async Task<ExchangeOrderResult> OnPlaceOrderAsync(ExchangeOrd
479
479
480
480
protected override async Task OnCancelOrderAsync ( string orderId , string marketSymbol = null , bool isClientOrderId = false )
481
481
{
482
- Dictionary < string , object > payload = new Dictionary < string , object > ( ) { { "order_ids" , new [ ] { orderId } } } ;
483
- await MakeJsonRequestAsync < JArray > ( "/orders/batch_cancel" , payload : payload , requestMethod : "POST" ) ;
484
- }
482
+ Dictionary < string , object > payload = new Dictionary < string , object > ( ) { { "order_ids" , new [ ] { orderId } } } ;
483
+ var responseJObj = await MakeJsonRequestAsync < JObject > ( "/orders/batch_cancel" , payload : payload , requestMethod : "POST" ) ;
484
+ if ( responseJObj [ "results" ] [ 0 ] . Value < bool > ( "success" ) != true )
485
+ {
486
+ Logger . Error ( "Failed to cancel coinbase order. {0}" , responseJObj [ "results" ] [ 0 ] . Value < string > ( "failure_reason" ) ) ;
487
+ throw new APIException ( "Failed to cancel coinbase order. " + responseJObj [ "results" ] [ 0 ] . Value < string > ( "failure_reason" ) ) ;
488
+ }
489
+ }
485
490
486
491
protected override Task < ExchangeWithdrawalResponse > OnWithdrawAsync ( ExchangeWithdrawalRequest withdrawalRequest )
487
492
{
0 commit comments