public static bool IsExceptionForError(this ErrorABI errorABI, RpcResponseException exception) { if (exception.RpcError.Data == null) { return(false); } var encodedData = exception.RpcError.Data.ToString(); if (!encodedData.IsHex()) { return(false); } return(encodedData.IsExceptionEncodedDataForError(errorABI.Sha3Signature)); }
public static void HandleContractRevertException(RpcResponseException rpcException) { if (rpcException.RpcError.Data != null) { var encodedErrorData = rpcException.RpcError.Data.ToString(); if (encodedErrorData.IsHex()) { //check normal revert new FunctionCallDecoder().ThrowIfErrorOnOutput(encodedErrorData); //throw custom error throw new SmartContractCustomErrorRevertException(encodedErrorData); } } }
protected abstract void HandleDataResponseError(RpcResponseException exception);
protected abstract void HandleUnsubscribeResponseError(RpcResponseException exception);
protected override void HandleResponseError(RpcResponseException exception) { ResponseSubject.OnError(exception); }
public StreamingEventArgs(RpcResponseException exception) { Exception = exception; }
public StreamingEventArgs(TEntity entity, RpcResponseException exception = null) { Response = entity; }
protected override void HandleUnsubscribeResponseError(RpcResponseException exception) { UnsubscribeResponse?.Invoke(this, new StreamingEventArgs <bool>(exception)); }
protected override void HandleDataResponseError(RpcResponseException exception) { SubscriptionDataResponse?.Invoke(this, new StreamingEventArgs <TSubscriptionDataResponse>(exception)); }
public TooManyRecordsException(RpcResponseException innerException) : base(innerException.Message, innerException) { }
protected override void HandleDataResponseError(RpcResponseException exception) { SubscriptionDataResponseSubject.OnError(exception); }
public bool IsExceptionForError(RpcResponseException exception) { return(ErrorABI.IsExceptionForError(exception)); }
protected override void HandleResponseError(RpcResponseException exception) { Response?.Invoke(this, new StreamingEventArgs <TResponse>(exception)); }
public static TooManyRecordsException TooManyRecordsException(this RpcResponseException rpcResponseEx) { return(new TooManyRecordsException(rpcResponseEx)); }
public static bool TooManyRecords(this RpcResponseException rpcResponseEx) { return(rpcResponseEx.Message.StartsWith(TooManyRecordsMessagePrefix)); }