Skip to content

Commit

Permalink
better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasuran committed Feb 20, 2024
1 parent 00efb13 commit 4dfbe0e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Latest tag

on:
push:
branches:
- master

jobs:
latest-tag:
runs-on: ubuntu-latest
steps:
- name: Set Latest Tag
uses: eliasuran/actions/latest@master
6 changes: 2 additions & 4 deletions gomon.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ func changeListener(filePath string, process *os.Process) {
initialStat, err := os.Stat(fullPath)

if err != nil {
response(400, "Error doing something")
fmt.Println(err)
response(400, "Error doing something: "+err.Error())
} else {
for {
stat, err := os.Stat(fullPath)
Expand All @@ -103,8 +102,7 @@ func changeListener(filePath string, process *os.Process) {
if process != nil {
err = process.Signal(syscall.SIGTERM)
if err != nil {
response(400, "Error when killing previous process")
fmt.Println(err)
response(400, "Error when killing previous process: "+err.Error())
}
process.Wait()
}
Expand Down

0 comments on commit 4dfbe0e

Please sign in to comment.