Skip to content

Commit

Permalink
fix(core): improve logger for silent errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ndcunningham committed May 9, 2024
1 parent 06b2fd9 commit 35f0439
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion e2e/utils/log-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export function logSuccess(title: string, body?: string) {
* @returns
*/
export function stripConsoleColors(log: string): string {
return log?.replace(
if (typeof log !== 'string') {
console.error('Expected a string but got:', typeof log, log);
return '';
}
return log.replace(
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
''
);
Expand Down

0 comments on commit 35f0439

Please sign in to comment.