Skip to content
This repository was archived by the owner on Oct 4, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions packages/common/src/utils/aaoErrorCodes.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
const aaoErrorEmojis = [
'😓',
'😭',
'😥',
'😮',
'🤬',
'😷',
'😿',
'😤',
'🙁',
'🙄',
'😣',
'😦',
'🤨'
]

const aaoErrorEmojis = {
0: '😓',
1: '😭',
2: '😥',
3: '😮',
4: '🤬',
5: '😷',
6: '😿',
7: '😤',
8: '🙁',
9: '🙄',
10: '😣',
11: '😦',
12: '😔',
'-1': '🤨'
}
/**
* Negative numbers are unexpected but valid, return last emoji.
* Positive numbers are expected, return emoji at index of error code.
* Positive numbers greater than total number of error codes are technically
* invalid, but ignore them and return last emoji to avoid errors.
**/
export const getAAOErrorEmojis = (errorCode: number): string => {
return aaoErrorEmojis[errorCode] ?? aaoErrorEmojis[aaoErrorEmojis.length - 1]
return aaoErrorEmojis[errorCode] ?? aaoErrorEmojis[-1]
}