Merge pull request #4163 from janhq/fix/display-error-message-from-source
chore: display error message from response
This commit is contained in:
commit
39cdbbaeb9
@ -46,8 +46,7 @@ const ModelSearch = ({ onSearchLocal }: Props) => {
|
|||||||
errMessage = err.message
|
errMessage = err.message
|
||||||
}
|
}
|
||||||
toaster({
|
toaster({
|
||||||
title: 'Oops, you may be rate limited, give it a bit more time',
|
title: errMessage,
|
||||||
description: errMessage,
|
|
||||||
type: 'error',
|
type: 'error',
|
||||||
})
|
})
|
||||||
console.error(err)
|
console.error(err)
|
||||||
|
|||||||
@ -64,7 +64,7 @@ describe('huggingface utils', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
await expect(fetchHuggingFaceRepoData('user/repo')).rejects.toThrow(
|
await expect(fetchHuggingFaceRepoData('user/repo')).rejects.toThrow(
|
||||||
'user/repo is not supported. Only GGUF models are supported.'
|
'Only GGUF models are currently supported.'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -34,9 +34,7 @@ export const fetchHuggingFaceRepoData = async (
|
|||||||
const data = response as HuggingFaceRepoData
|
const data = response as HuggingFaceRepoData
|
||||||
|
|
||||||
if (data.tags.indexOf('gguf') === -1) {
|
if (data.tags.indexOf('gguf') === -1) {
|
||||||
throw new Error(
|
throw new Error(`Only GGUF models are currently supported.`)
|
||||||
`${repoId} is not supported. Only GGUF models are supported.`
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// fetching file sizes
|
// fetching file sizes
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user