mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 14:37:17 +00:00
fix: http error for support ticket (#7746)
This commit is contained in:
parent
37937ea630
commit
ade45f5a70
3 changed files with 8 additions and 4 deletions
5
.changeset/ninety-deer-tap.md
Normal file
5
.changeset/ninety-deer-tap.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'hive': patch
|
||||
---
|
||||
|
||||
fix unexpected error for support tickets in case the user already exists within zendesk.
|
||||
|
|
@ -117,7 +117,7 @@ export class HttpClient {
|
|||
}
|
||||
}
|
||||
|
||||
class HiveHttpClientError extends Error {
|
||||
export class HiveHttpClientError extends Error {
|
||||
constructor(
|
||||
message: string,
|
||||
public code: string,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
import { createHash } from 'node:crypto';
|
||||
import { HTTPError } from 'got';
|
||||
import { Inject, Injectable, Scope } from 'graphql-modules';
|
||||
import { z } from 'zod';
|
||||
import { Organization, SupportTicketPriority, SupportTicketStatus } from '../../../shared/entities';
|
||||
import { atomic } from '../../../shared/helpers';
|
||||
import { AuditLogRecorder } from '../../audit-logs/providers/audit-log-recorder';
|
||||
import { Session } from '../../auth/lib/authz';
|
||||
import { HttpClient } from '../../shared/providers/http-client';
|
||||
import { HiveHttpClientError, HttpClient } from '../../shared/providers/http-client';
|
||||
import { Logger } from '../../shared/providers/logger';
|
||||
import { Storage } from '../../shared/providers/storage';
|
||||
import { OrganizationManager } from './../../organization/providers/organization-manager';
|
||||
|
|
@ -347,7 +346,7 @@ export class SupportManager {
|
|||
},
|
||||
);
|
||||
} catch (err) {
|
||||
if (err instanceof HTTPError && err.code === '422') {
|
||||
if (err instanceof HiveHttpClientError && err.code === '422') {
|
||||
// This user is already a member of this organization.
|
||||
this.logger.debug(
|
||||
'The user was already connected to the zendesk organization. (organization: %s, user: %s, zendeskUserId: %d, zendeskOrganizationId: %d)',
|
||||
|
|
|
|||
Loading…
Reference in a new issue