Skip to content

Commit

Permalink
Merge pull request #4163 from janhq/fix/display-error-message-from-so…
Browse files Browse the repository at this point in the history
…urce

chore: display error message from response
  • Loading branch information
louis-jan authored Nov 29, 2024
2 parents 226a224 + 492ff1a commit 39cdbba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions web/containers/ModelSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion web/utils/huggingface.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
)
})

Expand Down
4 changes: 1 addition & 3 deletions web/utils/huggingface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 39cdbba

Please sign in to comment.