mirror of https://github.com/stashapp/stash.git
fix json unmarshal error return (#1109)
This commit is contained in:
parent
9da11603c2
commit
714ae541d4
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue