-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix/bai 918 model card errors #950
Conversation
|
||
const response = await postFromSchema(model.id, newSchema.id) | ||
|
||
if (response.status && response.status < 400) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this not be if(!response.ok) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an axios request so the response doesn't have an ok
property. The response.statusText
will be 'OK'
if the response.status
is 200
, but we parse the response through handleAxiosError
which ignores the statusText
. If we want to change this I'd argue we can easily do it later on.
@@ -34,12 +35,15 @@ export default function FormEditPage({ model }: FormEditPageProps) { | |||
|
|||
async function onSubmit() { | |||
if (schema) { | |||
setErrorMessage('') | |||
setLoading(true) | |||
const data = getStepsData(splitSchema, true) | |||
const res = await putModelCard(model.id, data) | |||
if (res.status && res.status < 400) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use if (!res.ok)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #950 (comment)
@@ -66,6 +66,7 @@ export const getErrorMessage = async (res: Response) => { | |||
messageError = `${res.statusText}: ${(await res.json()).error.message}` | |||
} catch (e) { | |||
// unable to identify error message, possibly a network failure | |||
return 'Unknown error - Please contact Bailo support' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to put a link directly to our help page here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to, but this is just a util function that returns a string. We'd need additional logic everywhere it's being used to route the user to that page in the event of this happening.
I'm not against us doing that, but this isn't strictly a part of this ticket. I just noticed we weren't providing any feedback in this very niche scenario, so figured I'd put at least something in.
We can raise a ticket to address this if you want?
No description provided.