Skip to content

Commit

Permalink
refinement: error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmoriarty committed Apr 25, 2020
1 parent fa4a5d2 commit 4d50f76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gohack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestStubProcessNoDLL(t *testing.T) {

got := err.Error()

want := "Failed to get offset"
want := "Failed to get module offset"

if got != want {
t.Errorf("%q; want %q", got, want)
Expand All @@ -55,7 +55,7 @@ func TestStubProcess(t *testing.T) {

got := err.Error()

want := "Failed to get OffsetPlayer"
want := "Failed to get player offset"

if got != want {
t.Errorf("%q; want %q", got, want)
Expand Down
4 changes: 2 additions & 2 deletions internal/gohack/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ func ClientFrom(process *gomem.Process, offsets *Offsets) (*Client, error) {
offset, err := process.GetModule("client_panorama.dll")

if err != nil {
return nil, errors.New("Failed to get offset")
return nil, errors.New("Failed to get module offset")
}

client := &Client{Process: process, Offset: offset, Offsets: offsets}

process.Open()

if client.OffsetPlayer() == 0 {
return nil, errors.New("Failed to get OffsetPlayer")
return nil, errors.New("Failed to get player offset")
}

return client, nil
Expand Down

0 comments on commit 4d50f76

Please sign in to comment.