Skip to content

Commit 4c23cfb

Browse files
huchenleigithub-actions
andauthored
[API Node] Better execution error handling (#3587)
Co-authored-by: github-actions <[email protected]>
1 parent 9e10e55 commit 4c23cfb

File tree

11 files changed

+14
-159
lines changed

11 files changed

+14
-159
lines changed

src/components/dialog/content/ApiNodesSignInContent.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<ApiNodesList :node-names="apiNodeNames" />
1313

1414
<div class="flex justify-between items-center">
15-
<Button :label="t('g.learnMore')" link />
15+
<Button :label="t('g.learnMore')" link @click="handleLearnMoreClick" />
1616
<div class="flex gap-2">
1717
<Button
1818
:label="t('g.cancel')"
@@ -37,4 +37,8 @@ const { apiNodeNames, onLogin, onCancel } = defineProps<{
3737
onLogin?: () => void
3838
onCancel?: () => void
3939
}>()
40+
41+
const handleLearnMoreClick = () => {
42+
window.open('https://www.comfy.org/faq', '_blank')
43+
}
4044
</script>

src/components/dialog/content/SignInRequiredDialogContent.vue

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/locales/en/main.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,20 +1122,6 @@
11221122
"signOut": "Log Out",
11231123
"success": "Signed out successfully",
11241124
"successDetail": "You have been signed out of your account."
1125-
},
1126-
"required": {
1127-
"signIn": {
1128-
"title": "Sign-In Required to Execute Workflow",
1129-
"message": "This workflow includes nodes that require an active account. Please log in or create one to continue.",
1130-
"hint": "To login go to: Settings > User > Login",
1131-
"action": "Open Settings to Login"
1132-
},
1133-
"credits": {
1134-
"title": "Credits Required to Execute Workflow",
1135-
"message": "This workflow includes nodes that require credits. Please add credits to your account to continue.",
1136-
"hint": "To add credits go to: Settings > User > Credits",
1137-
"action": "Open Settings to Add Credits"
1138-
}
11391125
}
11401126
},
11411127
"validation": {

src/locales/es/main.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,6 @@
3636
"termsText": "Al hacer clic en \"Siguiente\" o \"Registrarse\", aceptas nuestros",
3737
"title": "Inicia sesión en tu cuenta"
3838
},
39-
"required": {
40-
"credits": {
41-
"action": "Abrir configuración para añadir créditos",
42-
"hint": "Para añadir créditos ve a: Configuración > Usuario > Créditos",
43-
"message": "Este flujo de trabajo incluye nodos que requieren créditos. Por favor, añade créditos a tu cuenta para continuar.",
44-
"title": "Créditos requeridos para ejecutar el flujo de trabajo"
45-
},
46-
"signIn": {
47-
"action": "Abrir configuración para iniciar sesión",
48-
"hint": "Para iniciar sesión ve a: Configuración > Usuario > Iniciar sesión",
49-
"message": "Este flujo de trabajo incluye nodos que requieren una cuenta activa. Por favor, inicia sesión o crea una para continuar.",
50-
"title": "Inicio de sesión requerido para ejecutar el flujo de trabajo"
51-
}
52-
},
5339
"signOut": {
5440
"signOut": "Cerrar sesión",
5541
"success": "Sesión cerrada correctamente",

src/locales/fr/main.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,6 @@
3636
"termsText": "En cliquant sur \"Suivant\" ou \"S'inscrire\", vous acceptez nos",
3737
"title": "Connectez-vous à votre compte"
3838
},
39-
"required": {
40-
"credits": {
41-
"action": "Ouvrir les paramètres pour ajouter des crédits",
42-
"hint": "Pour ajouter des crédits, allez dans : Paramètres > Utilisateur > Crédits",
43-
"message": "Ce workflow inclut des nœuds nécessitant des crédits. Veuillez ajouter des crédits à votre compte pour continuer.",
44-
"title": "Crédits requis pour exécuter le workflow"
45-
},
46-
"signIn": {
47-
"action": "Ouvrir les paramètres pour se connecter",
48-
"hint": "Pour vous connecter, allez dans : Paramètres > Utilisateur > Connexion",
49-
"message": "Ce workflow inclut des nœuds nécessitant un compte actif. Veuillez vous connecter ou en créer un pour continuer.",
50-
"title": "Connexion requise pour exécuter le workflow"
51-
}
52-
},
5339
"signOut": {
5440
"signOut": "Se déconnecter",
5541
"success": "Déconnexion réussie",

src/locales/ja/main.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,6 @@
3636
"termsText": "「次へ」または「サインアップ」をクリックすると、私たちの",
3737
"title": "アカウントにログインする"
3838
},
39-
"required": {
40-
"credits": {
41-
"action": "設定を開いてクレジットを追加",
42-
"hint": "クレジットを追加するには: 設定 > ユーザー > クレジット",
43-
"message": "このワークフローにはクレジットが必要なノードが含まれています。続行するにはアカウントにクレジットを追加してください。",
44-
"title": "ワークフロー実行にはクレジットが必要です"
45-
},
46-
"signIn": {
47-
"action": "設定を開いてログイン",
48-
"hint": "ログインするには: 設定 > ユーザー > ログイン",
49-
"message": "このワークフローにはアクティブなアカウントが必要なノードが含まれています。続行するにはログインまたはアカウントを作成してください。",
50-
"title": "ワークフロー実行にはサインインが必要です"
51-
}
52-
},
5339
"signOut": {
5440
"signOut": "ログアウト",
5541
"success": "正常にサインアウトしました",

src/locales/ko/main.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,6 @@
3636
"termsText": "\"다음\" 또는 \"가입하기\"를 클릭하면 우리의",
3737
"title": "계정에 로그인"
3838
},
39-
"required": {
40-
"credits": {
41-
"action": "설정에서 크레딧 추가 열기",
42-
"hint": "크레딧을 추가하려면: 설정 > 사용자 > 크레딧 으로 이동하세요.",
43-
"message": "이 워크플로에는 크레딧이 필요한 노드가 포함되어 있습니다. 계속하려면 계정에 크레딧을 추가하세요.",
44-
"title": "워크플로 실행을 위한 크레딧 필요"
45-
},
46-
"signIn": {
47-
"action": "설정에서 로그인 열기",
48-
"hint": "로그인하려면: 설정 > 사용자 > 로그인 으로 이동하세요.",
49-
"message": "이 워크플로에는 활성 계정이 필요한 노드가 포함되어 있습니다. 계속하려면 로그인하거나 계정을 생성하세요.",
50-
"title": "워크플로 실행을 위한 로그인 필요"
51-
}
52-
},
5339
"signOut": {
5440
"signOut": "로그아웃",
5541
"success": "성공적으로 로그아웃되었습니다",

src/locales/ru/main.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,6 @@
3636
"termsText": "Нажимая \"Далее\" или \"Зарегистрироваться\", вы соглашаетесь с нашими",
3737
"title": "Войдите в свой аккаунт"
3838
},
39-
"required": {
40-
"credits": {
41-
"action": "Открыть настройки для пополнения кредитов",
42-
"hint": "Чтобы пополнить кредиты, перейдите в: Настройки > Пользователь > Кредиты",
43-
"message": "Этот рабочий процесс содержит узлы, для которых необходимы кредиты. Пожалуйста, пополните баланс, чтобы продолжить.",
44-
"title": "Требуются кредиты для выполнения рабочего процесса"
45-
},
46-
"signIn": {
47-
"action": "Открыть настройки для входа",
48-
"hint": "Чтобы войти, перейдите в: Настройки > Пользователь > Вход",
49-
"message": "Этот рабочий процесс содержит узлы, для которых необходима активная учетная запись. Пожалуйста, войдите или создайте учетную запись, чтобы продолжить.",
50-
"title": "Требуется вход для выполнения рабочего процесса"
51-
}
52-
},
5339
"signOut": {
5440
"signOut": "Выйти",
5541
"success": "Вы успешно вышли из системы",

src/locales/zh/main.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,6 @@
3636
"termsText": "点击“下一步”或“注册”即表示您同意我们的",
3737
"title": "登录您的账户"
3838
},
39-
"required": {
40-
"credits": {
41-
"action": "打开设置进行充值",
42-
"hint": "要充值,请前往:设置 > 用户 > 积分",
43-
"message": "此工作流包含需要积分的节点。请为您的账户充值以继续。",
44-
"title": "需要积分以执行工作流"
45-
},
46-
"signIn": {
47-
"action": "打开设置进行登录",
48-
"hint": "要登录,请前往:设置 > 用户 > 登录",
49-
"message": "此工作流包含需要活跃账户的节点。请登录或创建账户以继续。",
50-
"title": "需要登录以执行工作流"
51-
}
52-
},
5339
"signOut": {
5440
"signOut": "退出登录",
5541
"success": "成功退出登录",

src/scripts/app.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,13 +674,18 @@ export class ComfyApp {
674674

675675
api.addEventListener('execution_error', ({ detail }) => {
676676
// Check if this is an auth-related error or credits-related error
677-
if (detail.exception_message === 'Please login first to use this node.') {
678-
useDialogService().showSignInRequiredDialog({ type: 'signIn' })
677+
if (
678+
detail.exception_message ===
679+
'Unauthorized: Please login first to use this node.'
680+
) {
681+
useDialogService().showApiNodesSignInDialog([detail.node_type])
679682
} else if (
680683
detail.exception_message ===
681684
'Payment Required: Please add credits to your account to use this node.'
682685
) {
683-
useDialogService().showSignInRequiredDialog({ type: 'credits' })
686+
useDialogService().showTopUpCreditsDialog({
687+
isInsufficientCredits: true
688+
})
684689
} else {
685690
useDialogService().showExecutionErrorDialog(detail)
686691
}

0 commit comments

Comments
 (0)