@@ -505,13 +505,27 @@ class ZenHubClient(val zenhubWorkspaceId: String = DEFAULT_WORKSPACE_ID) : AutoC
505505 fun createIssuePrConnection (issueId : String , pullRequestID : String ) = runBlocking {
506506 val input = CreateIssuePrConnectionInput (Optional .absent(), issueId, pullRequestID)
507507 val mutation = CreateIssuePrConnectionMutation (input)
508- apolloClient.mutation(mutation).execute()
508+ val response = apolloClient.mutation(mutation).execute()
509+
510+ if (response.hasErrors()) {
511+ val message = response.errors!! .joinToString { it.message }
512+ throw RuntimeException (" GraphQL request failed: $message " )
513+ }
514+
515+ response.data ? : throw IllegalStateException (" GraphQL returned no data and no errors" )
509516 }
510517
511518 fun deleteIssuePrConnection (issueId : String , pullRequestID : String ) = runBlocking {
512519 val input = DeleteIssuePrConnectionInput (Optional .absent(), issueId, pullRequestID)
513520 val mutation = DeleteIssuePrConnectionMutation (input)
514- apolloClient.mutation(mutation).execute()
521+ val response = apolloClient.mutation(mutation).execute()
522+
523+ if (response.hasErrors()) {
524+ val message = response.errors!! .joinToString { it.message }
525+ throw RuntimeException (" GraphQL request failed: $message " )
526+ }
527+
528+ response.data ? : throw IllegalStateException (" GraphQL returned no data and no errors" )
515529 }
516530
517531 fun addAssigneesToIssues (issueIds : List <String >, assigneeIds : List <String >) = runBlocking {
0 commit comments