Skip to content

Commit

Permalink
feat(wren-ui): add CreateThreadResponseExplain graphQL API error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
andreashimin committed Jul 19, 2024
1 parent 6022437 commit a119eba
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions wren-ui/src/utils/errorHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ class CreateRegeneratedThreadResponseErrorHandler extends ErrorHandler {
}
}

class CreateThreadResponseExplainErrorHandler extends ErrorHandler {
public getErrorMessage(error: GraphQLError) {
switch (error.extensions?.code) {
default:
return 'Failed to create thread response explain.';
}
}
}

class CreateViewErrorHandler extends ErrorHandler {
public getErrorMessage(error: GraphQLError) {
switch (error.extensions?.code) {
Expand Down Expand Up @@ -274,6 +283,10 @@ errorHandlers.set(
'CreateRegeneratedThreadResponse',
new CreateRegeneratedThreadResponseErrorHandler(),
);
errorHandlers.set(
'CreateThreadResponseExplain',
new CreateThreadResponseExplainErrorHandler(),
);
errorHandlers.set('CreateView', new CreateViewErrorHandler());
errorHandlers.set('UpdateDataSource', new UpdateDataSourceErrorHandler());
errorHandlers.set('CreateModel', new CreateModelErrorHandler());
Expand Down

0 comments on commit a119eba

Please sign in to comment.