fehlerbehebung

This commit is contained in:
xoy 2023-01-29 12:55:21 +01:00
parent 1359026aaa
commit 80971c0441
2 changed files with 6 additions and 4 deletions

View File

@ -304,8 +304,11 @@ func readHttpYML() string {
}
*/
func errorPanic(err error) {
func errorPanic(err error, logBefore ...string) {
if err != nil {
for _, log := range logBefore {
logger(log)
}
logger(err.Error())
panic("----------------ERROR----------------")
}

View File

@ -52,13 +52,12 @@ func httpHandleFuncWithPOST(urlPath string, filepath string, contentType string)
errorPanic(err)
out, err := os.Create("./web/images/" + files[i].Filename)
logger("unable to create the file '" + "./web/images/" + files[i].Filename + "' for writing. Check your write access privilege")
errorPanic(err)
errorPanic(err, "unable to create the file '"+"./web/images/"+files[i].Filename+"' for writing. Check your write access privilege")
_, err = io.Copy(out, file)
errorPanic(err)
logger(files[i].Filename)
logger("./web/images/" + files[i].Filename)
}
}
logger("date: " + date[0])