diff --git a/src/RokuDeploy.spec.ts b/src/RokuDeploy.spec.ts index d8437b7..a8f4032 100644 --- a/src/RokuDeploy.spec.ts +++ b/src/RokuDeploy.spec.ts @@ -1377,6 +1377,24 @@ describe('index', () => { 'Unknown error signing package' ); }); + + it('should return our fallback error if neither error or package link was detected', async () => { + mockDoGetRequest(` + + 789 + + `); + await expectThrowsAsync( + rokuDeploy.createSignedPackage({ + host: '1.2.3.4', + password: 'password', + signingPassword: options.signingPassword, + stagingDir: stagingDir, + devId: '123' + }), + `Package signing cancelled: provided devId '123' does not match on-device devId '789'` + ); + }); }); describe('prepublishToStaging', () => { diff --git a/src/RokuDeploy.ts b/src/RokuDeploy.ts index d2486d9..631c90e 100644 --- a/src/RokuDeploy.ts +++ b/src/RokuDeploy.ts @@ -423,8 +423,11 @@ export class RokuDeploy { let appName = parsedManifest.title + '/' + parsedManifest.major_version + '.' + parsedManifest.minor_version; //prevent devId mismatch (if devId is specified) - if (options.devId && options.devId !== await this.getDevId()) { - throw new Error('devId mismatch. nope, not gonna sign'); + if (options.devId) { + const deviceDevId = await this.getDevId(); + if (options.devId !== deviceDevId) { + throw new Error(`Package signing cancelled: provided devId '${options.devId}' does not match on-device devId '${deviceDevId}'`); + } } let requestOptions = this.generateBaseRequestOptions('plugin_package', options as any, {