refactor: cli updates (#2907)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
Jesvin Jose
2023-02-07 17:47:54 +05:30
committed by GitHub
parent f676f94278
commit cd72851289
13 changed files with 137 additions and 271 deletions

View File

@@ -1,4 +1,3 @@
import { log } from "console";
import * as S from "fp-ts/string";
import { HoppError, HoppErrorCode } from "../types/errors";
import { hasProperty, isSafeCommanderError } from "../utils/checks";
@@ -7,7 +6,7 @@ import { exceptionColors } from "../utils/getters";
const { BG_FAIL } = exceptionColors;
/**
* Parses unknown error data and narrows it to get information realted to
* Parses unknown error data and narrows it to get information related to
* error in string format.
* @param e Error data to parse.
* @returns Information in string format appropriately parsed, based on error type.
@@ -81,6 +80,6 @@ export const handleError = <T extends HoppErrorCode>(error: HoppError<T>) => {
}
if (!S.isEmpty(ERROR_MSG)) {
log(ERROR_CODE, ERROR_MSG);
console.error(ERROR_CODE, ERROR_MSG);
}
};
};