diff --git a/packages/platform/src/event.ts b/packages/platform/src/event.ts index babac9f96f..5e0ed1cc30 100644 --- a/packages/platform/src/event.ts +++ b/packages/platform/src/event.ts @@ -14,7 +14,7 @@ // limitations under the License. // -import { Status, unknownError, OK } from './status' +import { Status, OK } from './status' /** * @public @@ -72,13 +72,9 @@ async function broadcastEvent (event: string, data: any): Promise { * @param status - * @returns */ -export async function setPlatformStatus (status: Status | Error): Promise { - // console.log('platform status', status) - if (status instanceof Error) { - return await broadcastEvent(PlatformEvent, unknownError(status)) - } else { - return await broadcastEvent(PlatformEvent, status) - } +export async function setPlatformStatus (status: Status): Promise { + // console.log(await translate(status.code, status.params)) + return await broadcastEvent(PlatformEvent, status) } /** diff --git a/packages/platform/src/lang/en.json b/packages/platform/src/lang/en.json index 8114eb8e9d..ce7cf8ff86 100644 --- a/packages/platform/src/lang/en.json +++ b/packages/platform/src/lang/en.json @@ -2,6 +2,6 @@ "status": { "LoadingPlugin": "Loading plugin ''{plugin}''...", "UnknownError": "Unknown error: {message}", - "InvaldId": "Invalid Id: {id}" + "InvalidId": "Invalid Id: {id}" } }