refactor(logs): remove useless log and just panic (close #6)
This commit is contained in:
parent
c91d00418e
commit
94ed7f8fe5
1 changed files with 4 additions and 9 deletions
13
server.go
13
server.go
|
@ -160,7 +160,7 @@ func formHandler (c *fiber.Ctx) error {
|
||||||
sess, _ := Session.Get(c)
|
sess, _ := Session.Get(c)
|
||||||
|
|
||||||
if sess.Get("token") == nil {
|
if sess.Get("token") == nil {
|
||||||
log.Panic("Vous n’êtes pas connecté à Spotify.")
|
panic("Vous n’êtes pas connecté à Spotify.")
|
||||||
}
|
}
|
||||||
|
|
||||||
token := sess.Get("token").(string)
|
token := sess.Get("token").(string)
|
||||||
|
@ -169,7 +169,7 @@ func formHandler (c *fiber.Ctx) error {
|
||||||
|
|
||||||
e := testSpotifyPlaylist(token, tokentype, id)
|
e := testSpotifyPlaylist(token, tokentype, id)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
log.Panic(e.Error())
|
panic(e.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Set("Location", "/feudecamp")
|
c.Set("Location", "/feudecamp")
|
||||||
|
@ -178,7 +178,6 @@ func formHandler (c *fiber.Ctx) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getNew(c *fiber.Ctx) error {
|
func getNew(c *fiber.Ctx) error {
|
||||||
/* read session */
|
|
||||||
sess, _ := Session.Get(c)
|
sess, _ := Session.Get(c)
|
||||||
|
|
||||||
c.JSON(Queue[sess.Get("token").(string)])
|
c.JSON(Queue[sess.Get("token").(string)])
|
||||||
|
@ -221,12 +220,8 @@ func spotifyCallback(c *fiber.Ctx) error {
|
||||||
func index(c *fiber.Ctx) error {
|
func index(c *fiber.Ctx) error {
|
||||||
sess, _ := Session.Get(c)
|
sess, _ := Session.Get(c)
|
||||||
|
|
||||||
tmp := false
|
return c.Render("index", fiber.Map{"connected": sess.Get("token") != nil,
|
||||||
if sess.Get("token") != nil {
|
"url": SpotifyURL})
|
||||||
tmp = true
|
|
||||||
}
|
|
||||||
|
|
||||||
return c.Render("index", fiber.Map{"connected": tmp, "url": SpotifyURL})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func fdc(c *fiber.Ctx) error {
|
func fdc(c *fiber.Ctx) error {
|
||||||
|
|
Loading…
Reference in a new issue