fehlerbehebung
This commit is contained in:
parent
49205f06c5
commit
1e75f033b3
|
@ -8,7 +8,7 @@ func dbConnect(username string, password string, address string, port string, da
|
|||
db, err := sql.Open("mysql", username+":"+password+"@tcp("+address+":"+port+")/"+database)
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
panic(err.Error())
|
||||
}
|
||||
|
||||
return db
|
||||
|
@ -21,7 +21,7 @@ func dbClose(database *sql.DB) {
|
|||
func dbQuerry(database *sql.DB, sqlCode string) *sql.Rows {
|
||||
results, err := database.Query("SELECT id, name FROM tags")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
panic(err.Error())
|
||||
}
|
||||
|
||||
return results
|
||||
|
|
|
@ -11,7 +11,7 @@ func getEvents() []event {
|
|||
Event := new(event)
|
||||
err := rows.Scan(&Event.id, &Event.title, &Event.description, &Event.media, &Event.date)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
panic(err.Error())
|
||||
}
|
||||
events = append(events, *Event)
|
||||
}
|
||||
|
|
2
file.go
2
file.go
|
@ -9,7 +9,7 @@ func fileRead(src string) string {
|
|||
content, err := ioutil.ReadFile(src)
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
log.Fatal(err.Error())
|
||||
}
|
||||
|
||||
return string(content)
|
||||
|
|
10
func.go
10
func.go
|
@ -70,13 +70,13 @@ func getRoomState() status {
|
|||
c := &http.Client{Timeout: 10 * time.Second}
|
||||
r, err := c.Get("https://status.ctdo.de/api/simple/v2")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
panic(err.Error())
|
||||
}
|
||||
defer r.Body.Close()
|
||||
|
||||
body, _err := io.ReadAll(r.Body)
|
||||
if _err != nil {
|
||||
panic(_err)
|
||||
panic(_err.Error())
|
||||
}
|
||||
|
||||
bodyString := string(body)
|
||||
|
@ -99,7 +99,7 @@ func getRoomState() status {
|
|||
var __err error
|
||||
roomState.power, __err = strconv.ParseInt(temp[2], 0, 64)
|
||||
if __err != nil {
|
||||
panic(__err)
|
||||
panic(__err.Error())
|
||||
}
|
||||
|
||||
return *roomState
|
||||
|
@ -188,12 +188,12 @@ func getNextTopic() topic {
|
|||
if newDate[0] == "Thu" || newDate[0] == "Tue" {
|
||||
dayA, errA := strconv.Atoi(newDate[2])
|
||||
if errA != nil {
|
||||
panic(errA)
|
||||
panic(errA.Error())
|
||||
}
|
||||
|
||||
dayB, errB := strconv.Atoi(newDate[2])
|
||||
if errB != nil {
|
||||
panic(errB)
|
||||
panic(errB.Error())
|
||||
}
|
||||
|
||||
if ifFloatRange(float64(dayA)/7, 0, 1, false, true) || (ifFloatRange(float64(dayB)/7, 2, 3, false, true) && newDate[0] == "Tue") {
|
||||
|
|
Loading…
Reference in New Issue