feat: Enhance error handling with showErrorToast utility
- Replaced existing toast error messages with the new `showErrorToast` utility across multiple components, improving consistency in error reporting. - Updated error messages to provide more specific guidance for users, enhancing the overall user experience during error scenarios. - Ensured that all relevant error handling in batch management, external call configurations, cascading management, and screen management components now utilizes the new utility for better maintainability.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
import { toast } from "sonner";
|
||||
import { showErrorToast } from "@/lib/utils/toastUtils";
|
||||
import { apiClient } from "@/lib/api/client";
|
||||
import { ExtendedButtonTypeConfig, ButtonDataflowConfig } from "@/types/control-management";
|
||||
import { ButtonActionType } from "@/types/v2-core";
|
||||
@@ -383,7 +384,9 @@ export class ImprovedButtonActionExecutor {
|
||||
if (result.success) {
|
||||
toast.success(`관계 '${config.relationshipName}' 실행 완료`);
|
||||
} else {
|
||||
toast.error(`관계 '${config.relationshipName}' 실행 실패: ${result.message}`);
|
||||
showErrorToast(`관계 '${config.relationshipName}' 실행에 실패했습니다`, result.message, {
|
||||
guidance: "관계 설정과 대상 데이터를 확인해 주세요.",
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -396,7 +399,9 @@ export class ImprovedButtonActionExecutor {
|
||||
error: error.message,
|
||||
};
|
||||
|
||||
toast.error(errorResult.message);
|
||||
showErrorToast(`관계 '${config.relationshipName}' 실행에 실패했습니다`, error, {
|
||||
guidance: "관계 설정과 연결 상태를 확인해 주세요.",
|
||||
});
|
||||
return errorResult;
|
||||
}
|
||||
}
|
||||
@@ -1057,7 +1062,8 @@ export class ImprovedButtonActionExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
// 오류 토스트 표시
|
||||
toast.error(error.message || "작업 중 오류가 발생했습니다.");
|
||||
showErrorToast("버튼 액션 실행 중 오류가 발생했습니다", error, {
|
||||
guidance: "잠시 후 다시 시도해 주세요. 문제가 계속되면 관리자에게 문의해 주세요.",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user