Show generic error message on saving master data (this closes #45)

This commit is contained in:
Bernd Bestel
2018-09-08 09:26:12 +02:00
parent 496594d898
commit b01b49d10c
8 changed files with 29 additions and 12 deletions

View File

@@ -168,3 +168,18 @@ Grocy.FrontendHelpers.ValidateForm = function(formId)
$(form).addClass('was-validated');
}
Grocy.FrontendHelpers.ShowGenericError = function(message, exception)
{
toastr.error(L(message) + '<br><br>' + L('Click to show technical details'), '', {
onclick: function()
{
bootbox.alert({
title: L('Error details'),
message: JSON.stringify(exception, null, 4)
});
}
});
console.error(exception);
}