Compare commits
2 Commits
16cb8c7f58
...
7d1a0b82bd
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d1a0b82bd | |||
| eef77fa240 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
bin/
|
bin/
|
||||||
config.yaml
|
config.yaml
|
||||||
*.sqlite3
|
*.sqlite3
|
||||||
|
panic.log
|
||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
"time"
|
||||||
|
|
||||||
"git.oblat.lv/alex/triggerssmith/api"
|
"git.oblat.lv/alex/triggerssmith/api"
|
||||||
application "git.oblat.lv/alex/triggerssmith/internal/app"
|
application "git.oblat.lv/alex/triggerssmith/internal/app"
|
||||||
@@ -89,7 +90,11 @@ var serveCmd = &cobra.Command{
|
|||||||
slog.Error("Failed to open panic.log", slog.Any("error", err))
|
slog.Error("Failed to open panic.log", slog.Any("error", err))
|
||||||
} else {
|
} else {
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
f.WriteString(fmt.Sprintf("Panic: %v\n", r))
|
fmt.Fprintln(f, "\n--------------------------------------------------------\n")
|
||||||
|
fmt.Fprintf(f, "Time: %s\n", time.Now().Format(time.RFC3339))
|
||||||
|
fmt.Fprintln(f, "If this is unexpected, please report: https://git.oblat.lv/alex/triggerssmith/issues")
|
||||||
|
fmt.Fprintln(f, "\n--------------------------------------------------------\n")
|
||||||
|
fmt.Fprintf(f, "Panic: %v\n", r)
|
||||||
f.Write(stack)
|
f.Write(stack)
|
||||||
f.WriteString("\n\n")
|
f.WriteString("\n\n")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user