FusionAuth / fusionauth-client-builder

The FusionAuth client library builder
https://fusionauth.io/
Apache License 2.0
6 stars 24 forks source link

feat: critical bug on my part #23

Closed MCBrandenburg closed 3 years ago

robotdan commented 3 years ago

Is this just a correction from https://github.com/FusionAuth/fusionauth-client-builder/pull/22 ?

MCBrandenburg commented 3 years ago

Yes, I meant to put this in the up in the status code check. I was testing and getting unmarshall errors and realized what I had done. This could also be changed to:

    if resp.StatusCode < 200 || resp.StatusCode > 299 {
        if err = json.NewDecoder(resp.Body).Decode(rc.ErrorRef); err == io.EOF {
            err = nil
        }
    } else {
        rc.ErrorRef = nil
        if _, ok := rc.ResponseRef.(*BaseHTTPResponse); !ok {
            if err = json.NewDecoder(resp.Body).Decode(rc.ResponseRef); err == io.EOF {
                err = nil
            }
        }
    }
robotdan commented 3 years ago

Ok, got it. Yeah, if you want to submit another PR for additional handling that would be fine.