mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
TemplateProcessor: Toast a warning instead of error when encoutering an issue.
This commit is contained in:
@@ -326,18 +326,18 @@ Singleton {
|
|||||||
|
|
||||||
// Error reporting helpers
|
// Error reporting helpers
|
||||||
property string generator: ""
|
property string generator: ""
|
||||||
function showError() {
|
function showWarning() {
|
||||||
const description = (stderr.text && stderr.text.trim() !== "") ? stderr.text.trim() : ((stdout.text && stdout.text.trim() !== "") ? stdout.text.trim() : I18n.tr("toast.theming-processor-failed.desc-generic"))
|
const description = (stderr.text && stderr.text.trim() !== "") ? stderr.text.trim() : ((stdout.text && stdout.text.trim() !== "") ? stdout.text.trim() : I18n.tr("toast.theming-processor-failed.desc-generic"))
|
||||||
const title = I18n.tr(`toast.theming-processor-failed.title-${generator}`)
|
const title = I18n.tr(`toast.theming-processor-failed.title-${generator}`)
|
||||||
|
|
||||||
// Give a bit more time to the user to read, as it can contains important information for debugging user's templates.
|
// Give a bit more time to the user to read, as it can contains important information for debugging user's templates.
|
||||||
ToastService.showError(title, description, 8000)
|
ToastService.showWarning(title, description, 8000)
|
||||||
return description
|
return description
|
||||||
}
|
}
|
||||||
|
|
||||||
onExited: function (exitCode) {
|
onExited: function (exitCode) {
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
const description = generateProcess.showError()
|
const description = generateProcess.showWarning()
|
||||||
Logger.e("TemplateProcessor", "Process failed with exit code", exitCode, description)
|
Logger.e("TemplateProcessor", "Process failed with exit code", exitCode, description)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -351,7 +351,7 @@ Singleton {
|
|||||||
stderr: StdioCollector {
|
stderr: StdioCollector {
|
||||||
onStreamFinished: {
|
onStreamFinished: {
|
||||||
if (this.text) {
|
if (this.text) {
|
||||||
const description = generateProcess.showError()
|
const description = generateProcess.showWarning()
|
||||||
Logger.e("TemplateProcessor", "Process failed", description)
|
Logger.e("TemplateProcessor", "Process failed", description)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user