Skip to content

Commit

Permalink
fix: template schema parsing error feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
devcatalin committed Feb 21, 2022
1 parent 76c5dd5 commit 2e865bc
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 2e865bc

Please sign in to comment.