Throw an appropriate error for a non-OK gateway response. Extracted to keep sendGatewayRequest's cognitive complexity manageable.
sendGatewayRequest
The non-OK fetch Response
Gateway context (used to clear session on 401)
Throw an appropriate error for a non-OK gateway response. Extracted to keep
sendGatewayRequest's cognitive complexity manageable.