Merge pull request #4163 from janhq/fix/display-error-message-from-source

chore: display error message from response
This commit is contained in:
Louis 2024-11-29 16:58:18 +07:00 committed by GitHub
commit 39cdbbaeb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 6 deletions

View File

@ -46,8 +46,7 @@ const ModelSearch = ({ onSearchLocal }: Props) => {
errMessage = err.message
}
toaster({
title: 'Oops, you may be rate limited, give it a bit more time',
description: errMessage,
title: errMessage,
type: 'error',
})
console.error(err)

View File

@ -64,7 +64,7 @@ describe('huggingface utils', () => {
})
await expect(fetchHuggingFaceRepoData('user/repo')).rejects.toThrow(
'user/repo is not supported. Only GGUF models are supported.'
'Only GGUF models are currently supported.'
)
})

View File

@ -34,9 +34,7 @@ export const fetchHuggingFaceRepoData = async (
const data = response as HuggingFaceRepoData
if (data.tags.indexOf('gguf') === -1) {
throw new Error(
`${repoId} is not supported. Only GGUF models are supported.`
)
throw new Error(`Only GGUF models are currently supported.`)
}
// fetching file sizes