Skip to content

Commit

Permalink
explain the type casting in mapErrorMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
WafaaNasr committed Mar 2, 2023
1 parent 4d2e9a1 commit a2b46ef
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const mapErrorMessageToUserMessage = (
) => {
let concatenatedActionIds: string = '';
const mappedErrors = actionConnectorsErrors.map((connectorError) => {
// Using "as ImportResponseError" because the "id" field belongs only to
// "ImportResponseError" and if the connectorError has the id we use it to get the
// number of failing connectors by spliting the unique the connectors ids.
const { id, error } = connectorError as ImportResponseError;
concatenatedActionIds =
concatenatedActionIds && concatenatedActionIds !== id ? `${concatenatedActionIds},${id}` : id;
Expand Down

0 comments on commit a2b46ef

Please sign in to comment.