kun-galgame-vue/src/error/errorHandler.ts

19 lines
578 B
TypeScript
Raw Normal View History

2023-10-23 10:34:28 +00:00
// Global message component (top)
2023-10-13 15:05:30 +00:00
import Message from '@/components/alert/Message'
2023-10-03 12:55:53 +00:00
import { getErrorMessageEN, getErrorMessageCN } from './errorI18n'
const showMessage = (errorCode: number) => {
const messageType = 'error'
const messageTextEN = getErrorMessageEN(errorCode)
const messageTextCN = getErrorMessageCN(errorCode)
2023-10-13 15:05:30 +00:00
Message(messageTextEN, messageTextCN, messageType)
2023-10-03 12:55:53 +00:00
}
/**
2023-10-23 10:34:28 +00:00
* KUNGalgame known error handling function
* Error codes coordinated with the backend
2023-10-03 12:55:53 +00:00
*/
export const kungalgameErrorHandler = (errorNumber: number) => {
showMessage(errorNumber)
}