c.JSON(500,gin.H{"error":"Something went wrong on our end. Please report this bug at https://centrifuge.hectabit.org/hectabit/burgerbackup and refer to the documentation for more info. Your error code is: UNKNOWN-API-BACKUP-VERIFYERR","goErr":err.Error()})
log.Println("[ERROR] Error in /api/backup hash verify:",err)
c.JSON(500,gin.H{"error":"Something went wrong on our end. Please report this bug at https://centrifuge.hectabit.org/hectabit/burgerbackup and refer to the documentation for more info. Your error code is: UNKNOWN-API-BACKUP-FILEERR","goErr":err.Error()})
log.Println("[ERROR] Error in /api/backup file upload:",err)
}
return
}
encryptedFile,err:=file.Open()
iferr!=nil{
c.JSON(422,gin.H{"error":"Could not open file","goErr":err.Error()})
}
deferfunc(encryptedFilemultipart.File){
err:=encryptedFile.Close()
iferr!=nil{
c.JSON(500,gin.H{"error":"Something went wrong on our end. Please report this bug at https://centrifuge.hectabit.org/hectabit/burgerbackup and refer to the documentation for more info. Your error code is: UNKNOWN-API-BACKUP-FILEDEFERERR","goErr":err.Error()})
log.Println("[ERROR] Error in /api/backup file defer:",err)
return
}
}(encryptedFile)
encryptedData,err:=io.ReadAll(encryptedFile)
iferr!=nil{
c.JSON(500,gin.H{"error":"Something went wrong on our end. Please report this bug at https://centrifuge.hectabit.org/hectabit/burgerbackup and refer to the documentation for more info. Your error code is: UNKNOWN-API-BACKUP-FILECONTENTERR","goErr":err.Error()})
log.Println("[ERROR] Error in /api/backup file read:",err)
c.JSON(500,gin.H{"error":"Something went wrong on our end. Please report this bug at https://centrifuge.hectabit.org/hectabit/burgerbackup and refer to the documentation for more info. Your error code is: UNKNOWN-API-BACKUP-DECRYPTERR","goErr":err.Error()})
log.Println("[ERROR] Error in /api/backup file decrypt:",err)
c.JSON(500,gin.H{"error":"Something went wrong on our end. Please report this bug at https://centrifuge.hectabit.org/hectabit/burgerbackup and refer to the documentation for more info. Your error code is: UNKNOWN-API-BACKUP-JSONERR","goErr":err.Error()})
log.Println("[ERROR] Error in /api/backup file json:",err)
c.JSON(500,gin.H{"error":"Something went wrong on our end. Please report this bug at https://centrifuge.hectabit.org/hectabit/burgerbackup and refer to the documentation for more info. Your error code is: UNKNOWN-API-BACKUP-WRITEERR","goErr":err.Error()})
log.Println("[ERROR] Error in /api/backup file write:",err)