fix json unmarshal error return (#1109)

This commit is contained in:
SpedNSFW 2021-02-09 19:04:42 +11:00 committed by GitHub
parent 9da11603c2
commit 714ae541d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -61,6 +61,10 @@ func (s *scriptScraper) runScraperScript(inString string, out interface{}) error
// TODO - add a timeout here
decodeErr := json.NewDecoder(stdout).Decode(out)
if decodeErr != nil {
logger.Error("could not unmarshal json: " + decodeErr.Error())
return errors.New("could not unmarshal json: " + decodeErr.Error())
}
stderrData, _ := ioutil.ReadAll(stderr)
stderrString := string(stderrData)
@ -73,11 +77,6 @@ func (s *scriptScraper) runScraperScript(inString string, out interface{}) error
return errors.New("Error running scraper script")
}
if decodeErr != nil {
logger.Errorf("error decoding performer from scraper data: %s", err.Error())
return errors.New("Error decoding performer from scraper script")
}
return nil
}