Add ExternalError.description and GraphQLError.debug_info

This commit is contained in:
Mads Marquart
2020-01-15 14:03:35 +01:00
parent e25f53d9a9
commit 28791b2118
6 changed files with 36 additions and 26 deletions

View File

@@ -67,7 +67,7 @@ ERROR_DATA = [
@pytest.mark.parametrize("exception,code,description,summary", ERROR_DATA)
def test_handle_payload_error(exception, code, summary, description):
data = {"error": code, "errorSummary": summary, "errorDescription": description}
with pytest.raises(exception, match=r"#\d+: Error sending request"):
with pytest.raises(exception, match=r"Error sending request: #\d+"):
handle_payload_error(data)
@@ -97,7 +97,9 @@ def test_handle_graphql_errors():
"severity": "CRITICAL",
"summary": "Query error",
}
with pytest.raises(GraphQLError, match="#1675030: Errors while executing"):
with pytest.raises(
GraphQLError, match="Query error: #1675030, Errors while executing"
):
handle_graphql_errors({"data": {"message_thread": None}, "errors": [error]})