Skip to content

Commit

Permalink
Fix panic on errors.As() (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
Otterverse authored Jun 10, 2024
1 parent 8848c83 commit 0ae54b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ else ifeq ($(GOARCH),arm64)
LINUX_ARCH = aarch64
endif

GIT_REVISION = $(shell git rev-parse HEAD | tr -d '\n')
TAG_VERSION ?= $(shell git tag --points-at | sort -Vr | head -n1 | cut -c2-)
ifeq ($(shell git status -s),)
TAG_VERSION ?= $(shell git tag --points-at | sort -Vr | head -n1 | cut -c2-)
GIT_REVISION = $(shell git rev-parse HEAD | tr -d '\n')
endif
ifeq ($(TAG_VERSION),)
PATH_VERSION = custom
else
Expand Down
2 changes: 1 addition & 1 deletion cmd/viam-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func main() {
break
}

if errors.As(err, &exec.ExitError{}) {
if e := (&exec.ExitError{}); !errors.As(err, &e) {
// if it's not an ExitError, that means it didn't even start, so bail out
globalLogger.Error(errors.Wrap(err, "running 'systemctl is-active network-online.target'"))
break
Expand Down

0 comments on commit 0ae54b9

Please sign in to comment.