馃悰 Panic when repository is not valid
2023/01/05 12:04:31 [Recovery] 2023/01/05 - 12:04:31 panic recovered:
GET /api/v1/repositories/2/snapshots?page=0 HTTP/1.1
Host: localhost:3001
Connection: close
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7
Cache-Control: no-cache
Connection: close
Content-Type: application/json
Dnt: 1
Pragma: no-cache
Referer: http://localhost:3000/2
Sec-Ch-Ua: "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "Windows"
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:260 (0x454555)
panicmem: panic(memoryError)
/usr/local/go/src/runtime/signal_unix.go:835 (0x454525)
sigpanic: panicmem()
/home/deploy/resticgui/internal/api/repository.go:467 (0xe5ffcd)
GetSnapshotsRepository: c.IndentedJSON(http.StatusNotFound, gin.H{"error": errRInvalid, "message": err.Error()})
/home/deploy/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0x980281)
(*Context).Next: c.handlers[c.index](c)
/home/deploy/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/recovery.go:101 (0x98026c)
CustomRecoveryWithWriter.func1: c.Next()
/home/deploy/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0x97f386)
(*Context).Next: c.handlers[c.index](c)
/home/deploy/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/logger.go:240 (0x97f369)
LoggerWithConfig.func1: c.Next()
/home/deploy/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0x97e450)
(*Context).Next: c.handlers[c.index](c)
/home/deploy/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:616 (0x97e0b8)
(*Engine).handleHTTPRequest: c.Next()
/home/deploy/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:572 (0x97dbfc)
(*Engine).ServeHTTP: engine.handleHTTPRequest(c)
/usr/local/go/src/net/http/server.go:2947 (0x6d70cb)
serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
/usr/local/go/src/net/http/server.go:1991 (0x6d22e6)
(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
/usr/local/go/src/runtime/asm_amd64.s:1594 (0x46f8c0)
goexit: BYTE $0x90 // NOP
[GIN] 2023/01/05 - 12:04:31 | 500 | 496.500281ms | 127.0.0.1 | GET "/api/v1/repositories/2/snapshots?page=0"
2023/01/05 12:04:31 [Recovery] 2023/01/05 - 12:04:31 panic recovered:
GET /api/v1/repositories/2/snapshots?page=0 HTTP/1.1