Made error message format consistent (#591)

Co-authored-by: Max Isom <codetheweb@users.noreply.github.com>
This commit is contained in:
Rithwik Rayani 2022-03-24 04:58:06 +05:30 committed by GitHub
parent 88d49de5a1
commit cf49053370
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -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}`;
}
}