Skip to content

Commit

Permalink
Merge pull request #1395 from kubeshop/devcatalin/fix/template-error
Browse files Browse the repository at this point in the history
fix: template schema parsing error feedback
  • Loading branch information
devcatalin authored Feb 22, 2022
2 parents 3e120ae + 2e865bc commit d04c3d0
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {Theme as AntDTheme} from '@rjsf/antd';
import {withTheme} from '@rjsf/core';

import fs from 'fs';
import log from 'loglevel';
import {Primitive} from 'type-fest';

import {TemplateForm} from '@models/template';
Expand Down Expand Up @@ -47,8 +48,12 @@ const TemplateFormRenderer: React.FC<IProps> = props => {
setUiSchema(JSON.parse(schemas.uiSchema));
setErrorMessage(null);
setIsLoading(false);
} catch {
} catch (e) {
if (e instanceof Error) {
log.warn(`[loadTemplateSchemas]: ${e.message}`);
}
setErrorMessage("Couldn't read the schemas for this template form.");
setIsLoading(false);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
Expand Down

0 comments on commit d04c3d0

Please sign in to comment.