commit 409dcf4ed718185169e55c7b697cf2d18b895298
parent 24feab31d5616b133f4455894a3b0380290ddd4c
Author: dankert <openrat@jandankert.de>
Date: Tue, 1 Mar 2022 23:15:52 +0100
Fix: try without catch is not good, because the error will be thrown to the caller.
Diffstat:
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/modules/cms/ui/themes/default/script/openrat/form.js b/modules/cms/ui/themes/default/script/openrat/form.js
@@ -165,8 +165,15 @@ export default class Form {
this.close();
// Async: Window is closed, but the action will be startet now.
- await this.sendFormData( formData,mode );
- progressStatus.close();
+ try {
+ await this.sendFormData( formData,mode );
+ }
+ catch( error ) {
+ // no catch logic here, error messages are already displayed.
+ }
+ finally {
+ progressStatus.close();
+ }
}
}
diff --git a/modules/cms/ui/themes/default/script/openrat/form.min.js b/modules/cms/ui/themes/default/script/openrat/form.min.js
@@ -101,10 +101,16 @@ else
{
if ( mode == Form.modes.closeAfterSubmit )
this.close();
+try {
await this.sendFormData( formData,mode );
+}
+catch( error ) {
+}
+finally {
progressStatus.close();
}
}
+}
sendFormData = async function( formData,mode ) {
if ( !this.async )
this.isLoadStatus = true;