-
Notifications
You must be signed in to change notification settings - Fork 406
#RI-5856 - handle yaml error #3537
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
#RI-5856 - handle yaml error #3537
Conversation
…sInsight into fe/bugfix/RI-5856_incorrect_yaml
import { first, isArray, get } from 'lodash' | ||
import { AddRedisDatabaseStatus, EnhancedAxiosError, IBulkOperationResult } from 'uiSrc/slices/interfaces' | ||
import {AxiosError, AxiosResponse} from 'axios' | ||
import {first, isArray, get, set} from 'lodash' |
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.
please, add spaces
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.
Thanks
if (e instanceof YAMLException) { | ||
errors.push({ filename: 'config', msg: e.reason }) | ||
} | ||
} |
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.
could you please use here yamlToJson function
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.
Good point. Thank you.
}, | ||
}) | ||
dispatch(rdiDryRunJob(rdiInstanceId, JSON.parse(input), yaml.load(job))) | ||
dispatch(rdiDryRunJob(rdiInstanceId, JSON.parse(input), job)) |
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 fail here with JSON.parse?
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.
Nope, we validate submit button. If JSON.parse failed - the button will be disabled
No description provided.