public function onError(ResponseInterface $response, RequestInterface $request) {
        $json = $this->getResponseAsJson( $response );
        if( !is_null( $json ) && isset( $json->text )) {
            if( $json->text === 'access restricted to guild leaders' ) {
                throw new GuildLeaderRequiredException( $json->text, $response );
            } elseif( $json->text === 'membership required' ) {
                throw new MembershipRequiredException( $json->text, $response );
            }
        }
    }