From 7b11e48660e4015ba02e9711e264a6fa50e5c64a Mon Sep 17 00:00:00 2001 From: Vyacheslav Pushkin Date: Tue, 3 Dec 2019 18:57:22 +0400 Subject: [PATCH] Feature detection mechanism cuba-platform/cuba-rest-js#20 When setSessionLocale is not supported log a warning instead of throwing an error --- src/app/MainStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/MainStore.ts b/src/app/MainStore.ts index b0a3cfa..abf8f43 100644 --- a/src/app/MainStore.ts +++ b/src/app/MainStore.ts @@ -94,7 +94,7 @@ export class MainStore { setSessionLocale = () => { this.cubaREST.setSessionLocale().catch((reason) => { if (reason === CubaApp.NOT_SUPPORTED_BY_API_VERSION) { - throw new Error('Relogin is required in order for bean validation messages to use correct locale. ' + + console.warn('Relogin is required in order for bean validation messages to use correct locale. ' + 'Upgrade to REST API 7.2.0 or higher to be able to change locale without relogin.'); } else { throw new Error('Failed to set session locale');