fehlerbehebung
This commit is contained in:
parent
1359026aaa
commit
80971c0441
5
func.go
5
func.go
|
@ -304,8 +304,11 @@ func readHttpYML() string {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
func errorPanic(err error) {
|
func errorPanic(err error, logBefore ...string) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
for _, log := range logBefore {
|
||||||
|
logger(log)
|
||||||
|
}
|
||||||
logger(err.Error())
|
logger(err.Error())
|
||||||
panic("----------------ERROR----------------")
|
panic("----------------ERROR----------------")
|
||||||
}
|
}
|
||||||
|
|
5
http.go
5
http.go
|
@ -52,13 +52,12 @@ func httpHandleFuncWithPOST(urlPath string, filepath string, contentType string)
|
||||||
errorPanic(err)
|
errorPanic(err)
|
||||||
|
|
||||||
out, err := os.Create("./web/images/" + files[i].Filename)
|
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, "unable to create the file '"+"./web/images/"+files[i].Filename+"' for writing. Check your write access privilege")
|
||||||
errorPanic(err)
|
|
||||||
|
|
||||||
_, err = io.Copy(out, file)
|
_, err = io.Copy(out, file)
|
||||||
errorPanic(err)
|
errorPanic(err)
|
||||||
|
|
||||||
logger(files[i].Filename)
|
logger("./web/images/" + files[i].Filename)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger("date: " + date[0])
|
logger("date: " + date[0])
|
||||||
|
|
Loading…
Reference in New Issue