mirror of
https://git.macaw.me/skunky/SkunkyArt.git
synced 2025-04-28 12:05:06 +03:00
отображение ошибок
This commit is contained in:
parent
5a8a0987a2
commit
c39399403e
11 changed files with 74 additions and 35 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue