       # console.log 'purchase success', response
       Growl.notice 'Success', '购买成功'
     , (err) ->
-      console.log 'buychip error', err
+      error = err.data?.error || err.response?.data?.error
+      error_message = error.locale_message || error.message
+      Growl.error "", error_message
 
     $scope.hide()
 


      Growl.notice "", "下注:#{gameParam.amount}，几率:1/#{gameParam.odds}"
    , (err) ->
      console.log 'play error', err


  $scope.calculate_waiting_blocks = (trx) ->

      guess: $scope.guess_num

    GameAPI.play($scope.game_name, gameParam).then (resp) ->
      # console.log resp

      $scope.current_balance.amount -= gameParam.amount * $scope.current_balance.precision

