Beispiel #1
0
        private void handleResult(FFIResult result)
        {
            string message = "Unknown error";

            if (result.message.ToInt64() != 0)
            {
                message = CString.ToString(result.message);
                FreeString(result.message);
            }
            switch (result.tag)
            {
            case ResultTag.Ok: return;

            case ResultTag.InvalidArgument:
                throw new ArgumentException(message);

            case ResultTag.BinanceError:
                throw new BinanceError(message);

            case ResultTag.CoinbaseError:
                throw new CoinbaseError(message);

            case ResultTag.NashProtocolError:
                throw new NashProtocolError(message);

            case ResultTag.MissingImplementation:
                throw new MissingImplementation(message);

            case ResultTag.AssetNotFound:
                throw new AssetNotFound(message);

            case ResultTag.NoApiKeySet:
                throw new NoApiKeySet(message);

            case ResultTag.InternalServerError:
                throw new InternalServerError(message);

            case ResultTag.ServiceUnavailable:
                throw new ServiceUnavailable(message);

            case ResultTag.Unauthorized:
                throw new Unauthorized(message);

            case ResultTag.SymbolNotFound:
                throw new SymbolNotFound(message);

            case ResultTag.SocketError:
                throw new SocketError(message);

            case ResultTag.GetTimestampFailed:
                throw new GetTimestampFailed(message);

            case ResultTag.ReqError:
                throw new ReqError(message);

            case ResultTag.InvalidHeaderError:
                throw new InvalidHeaderError(message);

            case ResultTag.InvalidPayloadSignature:
                throw new InvalidPayloadSignature(message);

            case ResultTag.IoError:
                throw new IoError(message);

            case ResultTag.PoisonError:
                throw new PoisonError(message);

            case ResultTag.JsonError:
                throw new JsonError(message);

            case ResultTag.ParseFloatError:
                throw new ParseFloatError(message);

            case ResultTag.UrlParserError:
                throw new UrlParserError(message);

            case ResultTag.Tungstenite:
                throw new Tungstenite(message);

            case ResultTag.TimestampError:
                throw new TimestampError(message);

            case ResultTag.UnkownResponse:
                throw new UnkownResponse(message);

            case ResultTag.NotParsableResponse:
                throw new NotParsableResponse(message);

            case ResultTag.MissingParameter:
                throw new MissingParameter(message);

            case ResultTag.WebSocketMessageNotSupported:
                throw new WebSocketMessageNotSupported(message);
            }
        }
Beispiel #2
0
 private void handleFFIResult(FFIResult result)
 {
 }