Skip to content

Commit

Permalink
chore(connect-explorer): warn instead of error when json is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
mroz22 committed Jan 23, 2025
1 parent 2bdf118 commit 4666d8c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/connect-explorer/src/actions/methodActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ export const onCodeChange = (value: string) => (dispatch: Dispatch, getState: Ge
};
fields.forEach(processField);
} catch (error) {
console.error('Invalid JSON', error);
if (error.message.includes('JSON5:')) {
console.warn('Invalid JSON', error);
} else {
console.error(error);
}
}
};

0 comments on commit 4666d8c

Please sign in to comment.