error.js 1.2 KB

123456789101112131415161718192021222324252627
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.UnsupportedAlgorithmError = exports.CryptoError = exports.LengthOrHashMismatchError = exports.UnsignedMetadataError = exports.RepositoryError = exports.ValueError = void 0;
  4. // An error about insufficient values
  5. class ValueError extends Error {
  6. }
  7. exports.ValueError = ValueError;
  8. // An error with a repository's state, such as a missing file.
  9. // It covers all exceptions that come from the repository side when
  10. // looking from the perspective of users of metadata API or ngclient.
  11. class RepositoryError extends Error {
  12. }
  13. exports.RepositoryError = RepositoryError;
  14. // An error about metadata object with insufficient threshold of signatures.
  15. class UnsignedMetadataError extends RepositoryError {
  16. }
  17. exports.UnsignedMetadataError = UnsignedMetadataError;
  18. // An error while checking the length and hash values of an object.
  19. class LengthOrHashMismatchError extends RepositoryError {
  20. }
  21. exports.LengthOrHashMismatchError = LengthOrHashMismatchError;
  22. class CryptoError extends Error {
  23. }
  24. exports.CryptoError = CryptoError;
  25. class UnsupportedAlgorithmError extends CryptoError {
  26. }
  27. exports.UnsupportedAlgorithmError = UnsupportedAlgorithmError;