From cf4905337005768644178d46c744cfdc90bef7ff Mon Sep 17 00:00:00 2001 From: Rithwik Rayani <39290434+therithwikrayani@users.noreply.github.com> Date: Thu, 24 Mar 2022 04:58:06 +0530 Subject: [PATCH] Made error message format consistent (#591) Co-authored-by: Max Isom --- CHANGELOG.md | 2 ++ src/utils/error-msg.ts | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe7ba4a..5fdb65c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Error messages consistently show as `🚫 ope: error` ## [1.7.0] - 2022-03-19 ### Added diff --git a/src/utils/error-msg.ts b/src/utils/error-msg.ts index 0f4e0b2..ef03e76 100644 --- a/src/utils/error-msg.ts +++ b/src/utils/error-msg.ts @@ -1,11 +1,11 @@ export default (error?: string | Error): string => { - let str = '🚫 unknown error'; + let str = 'unknown error'; if (error) { if (typeof error === 'string') { - str = `🚫 ${error}`; + str = `🚫ope: ${error}`; } else if (error instanceof Error) { - str = `🚫 ope: ${error.message}`; + str = `🚫ope: ${error.message}`; } }