show string errors

This commit is contained in:
Kyle Spearrin 2018-05-02 16:00:46 -04:00
parent 66bdf442d6
commit c29b53cdd6
1 changed files with 3 additions and 1 deletions

View File

@ -12,7 +12,9 @@ export class ValidationService {
const defaultErrorMessage = this.i18nService.t('unexpectedError'); const defaultErrorMessage = this.i18nService.t('unexpectedError');
const errors: string[] = []; const errors: string[] = [];
if (data == null || typeof data !== 'object') { if (data != null && typeof data === 'string') {
errors.push(data);
} else if (data == null || typeof data !== 'object') {
errors.push(defaultErrorMessage); errors.push(defaultErrorMessage);
} else if (data.validationErrors == null) { } else if (data.validationErrors == null) {
errors.push(data.message ? data.message : defaultErrorMessage); errors.push(data.message ? data.message : defaultErrorMessage);