jan/web/utils/errorMessage.ts
NamH 510491253c
fix: error message being sent along with conversation when inference (#2242)
Signed-off-by: James <james@jan.ai>
Co-authored-by: James <james@jan.ai>
2024-03-05 22:09:38 +07:00

12 lines
313 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { ErrorCode } from '@janhq/core'
export const getErrorTitle = (errorCode: ErrorCode) => {
if (errorCode === ErrorCode.Unknown) {
return 'Apologies, somethings amiss!'
}
if (errorCode === ErrorCode.InvalidApiKey) {
return 'Invalid API key. Please check your API key and try again.'
}
}