No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

errors.js 882B

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.ErrorHandler = void 0;
  4. const clc = require("colorette");
  5. const logger_1 = require("../../logger");
  6. class ErrorHandler {
  7. constructor() {
  8. this.errors = [];
  9. }
  10. record(instanceId, type, message) {
  11. this.errors.push({
  12. instanceId,
  13. type,
  14. message: message,
  15. });
  16. }
  17. print() {
  18. logger_1.logger.info("");
  19. logger_1.logger.info("Extensions deploy had errors:");
  20. logger_1.logger.info("");
  21. for (const err of this.errors) {
  22. logger_1.logger.info(`- ${err.type} ${clc.bold(err.instanceId)}`);
  23. logger_1.logger.info(err.message);
  24. logger_1.logger.info("");
  25. }
  26. }
  27. hasErrors() {
  28. return this.errors.length > 0;
  29. }
  30. }
  31. exports.ErrorHandler = ErrorHandler;