Create instance from a gql exception.
(exc: TransportQueryError, request: gql.GraphQLRequest)
| 120 | |
| 121 | |
| 122 | def _query_error_from_transport(exc: TransportQueryError, request: gql.GraphQLRequest): |
| 123 | """Create instance from a gql exception.""" |
| 124 | try: |
| 125 | errors = cattrs.structure(exc.errors, list[QueryErrorValue]) |
| 126 | except (TypeError, KeyError, ValueError): |
| 127 | return None |
| 128 | return QueryError(errors, request) if errors else None |
| 129 | |
| 130 | |
| 131 | class ExecError(QueryError): |
no test coverage detected