Internationalize errors CheckUninstallProgressService

This commit is contained in:
Dylan Griffith 2019-04-30 14:49:26 +10:00 committed by Stan Hu
parent f84fae1386
commit d252b99a0e
2 changed files with 13 additions and 4 deletions

View file

@ -17,7 +17,7 @@ module Clusters
rescue Kubeclient::HttpError => e rescue Kubeclient::HttpError => e
log_error(e) log_error(e)
app.make_errored!("Kubernetes error: #{e.error_code}") app.make_errored!(_('Kubernetes error: %{error_code}') % { error_code: e.error_code })
end end
private private
@ -25,18 +25,18 @@ module Clusters
def on_success def on_success
app.destroy! app.destroy!
rescue StandardError => e rescue StandardError => e
app.make_errored!("Application uninstalled but failed to destroy: #{e.message}") app.make_errored!(_('Application uninstalled but failed to destroy: %{error_message}') % { error_message: e.message })
ensure ensure
remove_installation_pod remove_installation_pod
end end
def on_failed def on_failed
app.make_errored!("Operation failed. Check pod logs for #{pod_name} for more details.") app.make_errored!(_('Operation failed. Check pod logs for %{pod_name} for more details.') % { pod_name: pod_name })
end end
def check_timeout def check_timeout
if timed_out? if timed_out?
app.make_errored!("Operation timed out. Check pod logs for #{pod_name} for more details.") app.make_errored!(_('Operation timed out. Check pod logs for %{pod_name} for more details.') % { pod_name: pod_name })
else else
WaitForUninstallAppWorker.perform_in(WaitForUninstallAppWorker::INTERVAL, app.name, app.id) WaitForUninstallAppWorker.perform_in(WaitForUninstallAppWorker::INTERVAL, app.name, app.id)
end end

View file

@ -942,6 +942,9 @@ msgstr ""
msgid "Application settings saved successfully" msgid "Application settings saved successfully"
msgstr "" msgstr ""
msgid "Application uninstalled but failed to destroy: %{error_message}"
msgstr ""
msgid "Application was successfully destroyed." msgid "Application was successfully destroyed."
msgstr "" msgstr ""
@ -6274,6 +6277,12 @@ msgstr ""
msgid "Opens in a new window" msgid "Opens in a new window"
msgstr "" msgstr ""
msgid "Operation failed. Check pod logs for %{pod_name} for more details."
msgstr ""
msgid "Operation timed out. Check pod logs for %{pod_name} for more details."
msgstr ""
msgid "Operations" msgid "Operations"
msgstr "" msgstr ""