Add better responses

This commit is contained in:
Max Isom 2020-03-17 17:59:26 -05:00
parent 1a1bdfd674
commit 15d4e251f2
17 changed files with 103 additions and 63 deletions

13
src/utils/error-msg.ts Normal file
View file

@ -0,0 +1,13 @@
export default (error?: string | Error): string => {
let str = '🚫 unknown error';
if (error) {
if (typeof error === 'string') {
str = `🚫 ${error}`;
} else if (error instanceof Error) {
str = `🚫 error: ${error.name}`;
}
}
return str;
};