From acc09307794a829050050cbe2f578e79b4f3929e Mon Sep 17 00:00:00 2001 From: Yosif Yosifov Date: Thu, 9 Mar 2017 16:21:38 +0200 Subject: [PATCH] Equalize the non-existent device error message #2446 --- lib/services/platform-service.ts | 6 ++++-- test/npm-support.ts | 2 ++ test/platform-commands.ts | 2 ++ test/platform-service.ts | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index b749a35c93..eb5f71fd18 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -40,7 +40,9 @@ export class PlatformService extends EventEmitter implements IPlatformService { private $deviceAppDataFactory: Mobile.IDeviceAppDataFactory, private $projectChangesService: IProjectChangesService, private $emulatorPlatformService: IEmulatorPlatformService, - private $analyticsService: IAnalyticsService) { + private $analyticsService: IAnalyticsService, + private $messages: IMessages, + private $staticConfig: Config.IStaticConfig) { super(); } @@ -504,7 +506,7 @@ export class PlatformService extends EventEmitter implements IPlatformService { } if (found.length === 0) { - this.$errors.fail("Cannot find device with name: %s", emulateOptions.device); + this.$errors.fail(this.$messages.Devices.NotFoundDeviceByIdentifierErrorMessage, this.$staticConfig.CLIENT_NAME.toLowerCase()); } } } diff --git a/test/npm-support.ts b/test/npm-support.ts index 4ee208d307..f4c620367f 100644 --- a/test/npm-support.ts +++ b/test/npm-support.ts @@ -26,6 +26,7 @@ import { DevicePlatformsConstants } from "../lib/common/mobile/device-platforms- import { XmlValidator } from "../lib/xml-validator"; import { LockFile } from "../lib/lockfile"; import ProjectChangesLib = require("../lib/services/project-changes-service"); +import { Messages } from "../lib/common/messages/messages"; import path = require("path"); import temp = require("temp"); @@ -82,6 +83,7 @@ function createTestInjector(): IInjector { testInjector.register("analyticsService", { track: async () => undefined }); + testInjector.register("messages", Messages); return testInjector; } diff --git a/test/platform-commands.ts b/test/platform-commands.ts index 429168da5e..a89c2758bc 100644 --- a/test/platform-commands.ts +++ b/test/platform-commands.ts @@ -21,6 +21,7 @@ import { XmlValidator } from "../lib/xml-validator"; import * as ChildProcessLib from "../lib/common/child-process"; import { CleanCommand } from "../lib/commands/platform-clean"; import ProjectChangesLib = require("../lib/services/project-changes-service"); +import { Messages } from "../lib/common/messages/messages"; let isCommandExecuted = true; @@ -139,6 +140,7 @@ function createTestInjector() { testInjector.register("analyticsService", { track: async () => undefined }); + testInjector.register("messages", Messages); return testInjector; } diff --git a/test/platform-service.ts b/test/platform-service.ts index 4b526e2023..94aca1a1e1 100644 --- a/test/platform-service.ts +++ b/test/platform-service.ts @@ -19,6 +19,7 @@ import { DevicePlatformsConstants } from "../lib/common/mobile/device-platforms- import { XmlValidator } from "../lib/xml-validator"; import * as ChildProcessLib from "../lib/common/child-process"; import ProjectChangesLib = require("../lib/services/project-changes-service"); +import { Messages } from "../lib/common/messages/messages"; require("should"); let temp = require("temp"); @@ -80,6 +81,7 @@ function createTestInjector() { testInjector.register("analyticsService", { track: async () => undefined }); + testInjector.register("messages", Messages); return testInjector; }