Skip to content

Commit 5daa3fc

Browse files
author
naman-contentstack
committed
updated the error handling
1 parent 9bb033c commit 5daa3fc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/lib/helper.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ export interface FormattedError {
2525
*/
2626
export const printFormattedError = (error: FormattedError, context: string) => {
2727
const errorCode = error?.error_code || "UNKNOWN_ERROR";
28+
// Special handling for our numeric identifier validation errors
29+
if (
30+
errorCode === "VALIDATION_ERROR" &&
31+
error?.error_message &&
32+
error.error_message.includes("numeric identifiers")
33+
) {
34+
// Just print our detailed message as-is, no extra formatting
35+
cliux.print(error.error_message, {
36+
color: "red",
37+
bold: true,
38+
});
39+
return;
40+
}
41+
2842
let errorMessage = "An unexpected error occurred";
2943
let hint = "";
3044

0 commit comments

Comments
 (0)