Skip to content

Commit b8cc493

Browse files
fix: revert error message for already terminated services. 📝
1 parent d10f88d commit b8cc493

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/intents.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export function createService (cozy, intentId, serviceWindow) {
145145
let terminated = false
146146

147147
const terminate = (message) => {
148-
if (terminated) throw new Error('Intent service has been terminated')
148+
if (terminated) throw new Error('Intent service has already been terminated')
149149
terminated = true
150150
serviceWindow.parent.postMessage(message, intent.attributes.client)
151151
}

test/unit/intents.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ describe('Intents', function () {
524524

525525
should.throws(() => {
526526
service.terminate(result)
527-
}, /Intent service has been terminated/)
527+
}, /Intent service has already been terminated/)
528528
})
529529
})
530530

@@ -596,7 +596,7 @@ describe('Intents', function () {
596596

597597
should.throws(() => {
598598
service.cancel()
599-
}, /Intent service has been terminated/)
599+
}, /Intent service has already been terminated/)
600600
})
601601

602602
it('should forbbid further calls to terminate()', async function () {
@@ -622,7 +622,7 @@ describe('Intents', function () {
622622

623623
should.throws(() => {
624624
service.terminate(result)
625-
}, /Intent service has been terminated/)
625+
}, /Intent service has already been terminated/)
626626
})
627627
})
628628

@@ -680,7 +680,7 @@ describe('Intents', function () {
680680

681681
should.throws(() => {
682682
service.cancel()
683-
}, /Intent service has been terminated/)
683+
}, /Intent service has already been terminated/)
684684
})
685685

686686
it('should forbbid further calls to terminate()', async function () {
@@ -706,7 +706,7 @@ describe('Intents', function () {
706706

707707
should.throws(() => {
708708
service.terminate(result)
709-
}, /Intent service has been terminated/)
709+
}, /Intent service has already been terminated/)
710710
})
711711
})
712712
})

0 commit comments

Comments
 (0)