отображение ошибок

This commit is contained in:
lost+skunk 2024-09-04 20:22:58 +03:00
parent 5a8a0987a2
commit c39399403e
11 changed files with 74 additions and 35 deletions

View file

@ -58,8 +58,12 @@ func (a API) Random() {
a.Error("Sorry, butt NSFW on this are disabled, and the instance failed to find a random art without NSFW", 500)
}
s, err := devianter.PerformSearch(string(rand.Intn(999)), rand.Intn(30), 'a')
s, err, daErr := devianter.PerformSearch(string(rand.Intn(999)), rand.Intn(30), 'a')
try(err)
if daErr.RAW != nil {
continue
}
deviation := &s.Results[rand.Intn(len(s.Results))]
if deviation.NSFW && !CFG.Nsfw {