GraphQL response of 403 in React JS

When GraphQL receives a 403 response, it crashes with a NetworkError:

ServerParseError: Unexpected end of JSON input

Is there a way to gracefully catch these errors? I’m using the React and it breaks the entire app.