File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import type {
55 ApiZodErrorExtension ,
66} from '../../graphql/common' ;
77import { gqlClient , ApiError } from '../../graphql/common' ;
8- import { labels } from '../../lib' ;
98import {
109 ACCEPT_OPPORTUNITY_MATCH ,
1110 ADD_OPPORTUNITY_SEATS_MUTATION ,
@@ -474,7 +473,13 @@ export const getParseOpportunityMutationErrorMessage = (
474473 ) ;
475474 }
476475
477- return error ?. response ?. errors ?. [ 0 ] ?. message || labels . error . generic ;
476+ if ( error ?. response ?. errors ?. [ 0 ] ?. extensions ?. code === ApiError . Unexpected ) {
477+ return PARSE_OPPORTUNITY_ERROR_MESSAGE ;
478+ }
479+
480+ return (
481+ error ?. response ?. errors ?. [ 0 ] ?. message || PARSE_OPPORTUNITY_ERROR_MESSAGE
482+ ) ;
478483} ;
479484
480485export const parseOpportunityMutationOptions = ( ) => {
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ export enum ApiError {
115115 ZodValidationError = 'ZOD_VALIDATION_ERROR' ,
116116 Conflict = 'CONFLICT' ,
117117 PaymentRequired = 'PAYMENT_REQUIRED' ,
118+ Unexpected = 'UNEXPECTED' ,
118119}
119120
120121export enum ApiErrorMessage {
You can’t perform that action at this time.
0 commit comments