mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
fix json unmarshal error return (#1109)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user