Skip to content

Commit

Permalink
Improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Jun 18, 2021
1 parent ab0fa38 commit ae4a85d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ describe('Swimlane Service', () => {
incident,
})
).rejects.toThrow(
`[Action][Swimlane]: Unable to create record in application with id ${config.appId}. Error: An error has occurred. Reason: `
`[Action][Swimlane]: Unable to create record in application with id ${config.appId}. Error: An error has occurred. Reason: unknown`
);
});

Expand All @@ -393,7 +393,7 @@ describe('Swimlane Service', () => {
incident,
})
).rejects.toThrow(
`[Action][Swimlane]: Unable to create record in application with id ${config.appId}. Error: An error has occurred. Reason: `
`[Action][Swimlane]: Unable to create record in application with id ${config.appId}. Error: An error has occurred. Reason: unknown`
);
});

Expand All @@ -410,7 +410,7 @@ describe('Swimlane Service', () => {
incident,
})
).rejects.toThrow(
`[Action][Swimlane]: Unable to create record in application with id ${config.appId}. Error: An error has occurred. Reason: `
`[Action][Swimlane]: Unable to create record in application with id ${config.appId}. Error: An error has occurred. Reason: unknown`
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import * as i18n from './translations';

const createErrorMessage = (errorResponse: ResponseError | null | undefined): string => {
if (errorResponse == null) {
return '';
return 'unknown';
}

const { ErrorCode, Argument } = errorResponse;
return Argument != null && ErrorCode != null ? `${Argument} (${ErrorCode})` : '';
return Argument != null && ErrorCode != null ? `${Argument} (${ErrorCode})` : 'unknown';
};

export const createExternalService = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const EditConnector = React.memo(
schema,
});

const { setFieldValue, submit, getErrors } = form;
const { setFieldValue, submit } = form;

const [{ currentConnector, fields, editConnector }, dispatch] = useReducer(
editConnectorReducer,
Expand Down

0 comments on commit ae4a85d

Please sign in to comment.