diff --git a/apps/dcellar-web-ui/CHANGELOG.json b/apps/dcellar-web-ui/CHANGELOG.json index dd9617a2..6e75a92d 100644 --- a/apps/dcellar-web-ui/CHANGELOG.json +++ b/apps/dcellar-web-ui/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "dcellar-web-ui", "entries": [ + { + "version": "1.7.3", + "tag": "dcellar-web-ui_v1.7.3", + "date": "Fri, 06 Sep 2024 07:48:42 GMT", + "comments": { + "patch": [ + { + "comment": "semantic delegate create folder error message" + } + ] + } + }, { "version": "1.7.2", "tag": "dcellar-web-ui_v1.7.2", diff --git a/apps/dcellar-web-ui/CHANGELOG.md b/apps/dcellar-web-ui/CHANGELOG.md index 602d46cb..f3e724f5 100644 --- a/apps/dcellar-web-ui/CHANGELOG.md +++ b/apps/dcellar-web-ui/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log - dcellar-web-ui -This log was last generated on Wed, 21 Aug 2024 03:41:57 GMT and should not be manually modified. +This log was last generated on Fri, 06 Sep 2024 07:48:42 GMT and should not be manually modified. + +## 1.7.3 +Fri, 06 Sep 2024 07:48:42 GMT + +### Patches + +- semantic delegate create folder error message ## 1.7.2 Wed, 21 Aug 2024 03:41:57 GMT diff --git a/apps/dcellar-web-ui/package.json b/apps/dcellar-web-ui/package.json index 2d531d7b..8b5f6624 100644 --- a/apps/dcellar-web-ui/package.json +++ b/apps/dcellar-web-ui/package.json @@ -1,6 +1,6 @@ { "name": "dcellar-web-ui", - "version": "1.7.2", + "version": "1.7.3", "private": false, "scripts": { "dev": "node ./scripts/dev.js -p 3200", diff --git a/apps/dcellar-web-ui/src/facade/error.ts b/apps/dcellar-web-ui/src/facade/error.ts index b0821917..8a29371c 100644 --- a/apps/dcellar-web-ui/src/facade/error.ts +++ b/apps/dcellar-web-ui/src/facade/error.ts @@ -149,3 +149,13 @@ export const queryLockFeeFault = (e: any): ErrorResponse => { return [null, E_UNKNOWN_ERROR]; }; + +export const semanticRPCError = (err: string): string => { + if (!err) return E_UNKNOWN_ERROR; + const errorList = [ + { key: 'is frozen', message: 'Your account is frozen. Please deposit to reactivate it.' }, + ]; + const foundError = errorList.find(({ key }) => err.includes(key)); + + return foundError?.message ?? err; +}; diff --git a/apps/dcellar-web-ui/src/facade/object.ts b/apps/dcellar-web-ui/src/facade/object.ts index 9b3a016e..7652f9d5 100644 --- a/apps/dcellar-web-ui/src/facade/object.ts +++ b/apps/dcellar-web-ui/src/facade/object.ts @@ -13,6 +13,7 @@ import { commonFault, createTxFault, queryLockFeeFault, + semanticRPCError, simulateFault, } from '@/facade/error'; import { getClient } from '@/facade/index'; @@ -720,8 +721,8 @@ export const delegateCreateFolder = async ( .delegateCreateFolder(request, auth) .then(resolve, commonFault); - if (!result || error) return [null, error]; - if (result.code !== 0 || !result.body) return [null, result.message ?? '']; + if (!result || error) return [null, semanticRPCError(error)]; + if (result.code !== 0 || !result.body) return [null, semanticRPCError(result.message ?? '')]; return [result.body, null]; };