From 9174dbe8a9057e240fd9c3825c5720d13f2fafc2 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Sun, 3 Jul 2022 14:56:52 -0700 Subject: Add error message handling to client --- hotline/transaction.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hotline/transaction.go') diff --git a/hotline/transaction.go b/hotline/transaction.go index 88e17df..9b0ac40 100644 --- a/hotline/transaction.go +++ b/hotline/transaction.go @@ -1,6 +1,7 @@ package hotline import ( + "bytes" "encoding/binary" "errors" "fmt" @@ -238,3 +239,7 @@ func (t *Transaction) GetField(id int) Field { return Field{} } + +func (t *Transaction) IsError() bool { + return bytes.Compare(t.ErrorCode, []byte{0, 0, 0, 1}) == 0 +} -- cgit