Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
fix: error message
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed Dec 8, 2017
1 parent f49e753 commit 8305d20
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/keychain.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Keychain {
const dsname = DsName(name)
self.store.has(dsname, (err, exists) => {
if (err) return _error(callback, err)
if (exists) return _error(callback, `Key '${name}' already exists'`)
if (exists) return _error(callback, `Key '${name}' already exists`)

switch (type.toLowerCase()) {
case 'rsa':
Expand Down Expand Up @@ -212,7 +212,7 @@ class Keychain {
const pem = res.toString()
self.store.has(newDsname, (err, exists) => {
if (err) return _error(callback, err)
if (exists) return _error(callback, `Key '${newName}' already exists'`)
if (exists) return _error(callback, `Key '${newName}' already exists`)

const batch = self.store.batch()
batch.put(newDsname, pem)
Expand Down Expand Up @@ -266,7 +266,7 @@ class Keychain {
const dsname = DsName(name)
self.store.has(dsname, (err, exists) => {
if (err) return _error(callback, err)
if (exists) return _error(callback, `Key '${name}' already exists'`)
if (exists) return _error(callback, `Key '${name}' already exists`)
try {
const privateKey = forge.pki.decryptRsaPrivateKey(pem, password)
if (privateKey === null) {
Expand Down Expand Up @@ -295,7 +295,7 @@ class Keychain {
const dsname = DsName(name)
self.store.has(dsname, (err, exists) => {
if (err) return _error(callback, err)
if (exists) return _error(callback, `Key '${name}' already exists'`)
if (exists) return _error(callback, `Key '${name}' already exists`)

const privateKeyProtobuf = peer.marshalPrivKey()
crypto.keys.unmarshalPrivateKey(privateKeyProtobuf, (err, key) => {
Expand Down

0 comments on commit 8305d20

Please sign in to comment.