-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JavaScript errors have a `.name` property that can be used to disambiguate the type of error. libp2p has used the `.code` property for this until now, but we will soon use that field to indicate remote errors, so switch to using the `.name` property. BREAKING CHANGE: The `.code` property has been removed from most errors, use `.name` instead
- Loading branch information
1 parent
b435a21
commit 0d20426
Showing
194 changed files
with
1,862 additions
and
1,394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* The handshake timed out | ||
*/ | ||
export class HandshakeTimeoutError extends Error { | ||
constructor (message = 'Handshake timeout') { | ||
super(message) | ||
this.name = 'HandshakeTimeoutError' | ||
} | ||
} | ||
|
||
/** | ||
* The certificate was invalid | ||
*/ | ||
export class InvalidCertificateError extends Error { | ||
constructor (message = 'Invalid certificate') { | ||
super(message) | ||
this.name = 'InvalidCertificateError' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Signing a message failed | ||
*/ | ||
export class SigningError extends Error { | ||
constructor (message = 'An error occurred while signing a message') { | ||
super(message) | ||
this.name = 'SigningError' | ||
} | ||
} | ||
|
||
/** | ||
* Verifying a message signature failed | ||
*/ | ||
export class VerificationError extends Error { | ||
constructor (message = 'An error occurred while verifying a message') { | ||
super(message) | ||
this.name = 'VerificationError' | ||
} | ||
} | ||
|
||
/** | ||
* WebCrypto was not available in the current context | ||
*/ | ||
export class WebCryptoMissingError extends Error { | ||
constructor (message = 'Missing Web Crypto API') { | ||
super(message) | ||
this.name = 'WebCryptoMissingError' | ||
} | ||
} |
Oops, something went wrong.