cjrasmussen / BlueskyApi

Simple helper for interacting with the Bluesky API/AT protocol
MIT License
27 stars 5 forks source link

Undefined property: stdClass::$error #8

Closed pixeline closed 9 months ago

pixeline commented 9 months ago

This error points to line: /vendor/cjrasmussen/bluesky-api/src/BlueskyApi.php:153

it should be

        $data = $this->request('POST', 'com.atproto.server.createSession', $args);

        if (!empty($data->error)) {
            throw new RuntimeException($data->message);
        }

I'm not even sure $data->error will actually ever be created, as $data is the result of json_decode().

Thanks!

cjrasmussen commented 9 months ago

Good catch. Fixed in v2.0.1.

As for $data->error ever being created... If I recall correctly, this was specifically related to #6 and com.atproto.server.createSession returning an error value when hitting rate limits.

jaybeaton commented 2 months ago

@cjrasmussen

You'll need to make this same change in BlueskyApi::refreshSession().

cjrasmussen commented 2 months ago

@jaybeaton

Thanks for the heads-up. Resolved in v2.0.2.