mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-06-28 01:32:42 +02:00
Add better responses
This commit is contained in:
parent
1a1bdfd674
commit
15d4e251f2
17 changed files with 103 additions and 63 deletions
13
src/utils/error-msg.ts
Normal file
13
src/utils/error-msg.ts
Normal 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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue