native-document 1.0.178 → 1.0.179

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-document",
3
- "version": "1.0.178",
3
+ "version": "1.0.179",
4
4
  "description": "A reactive JavaScript framework that preserves native DOM simplicity without sacrificing modern features",
5
5
  "author": "AfroCodeur <https://github.com/afrocodeur>",
6
6
  "license": "MIT",
@@ -407,11 +407,12 @@ FormControl.prototype.$handleSubmit = async function(event) {
407
407
  return result;
408
408
 
409
409
  } catch(error) {
410
- this.$dispatchServerErrors(error);
411
- this.emit('error', error, this);
412
- if(!this.hasListeners('error')) {
410
+ const errorsMapper = this.$description.errorsMapper || FormControl.defaultErrorsMapper;
411
+ if(!errorsMapper && !this.hasListeners('error')) {
413
412
  throw error;
414
413
  }
414
+ this.$dispatchServerErrors(error);
415
+ this.emit('error', error, this);
415
416
  } finally {
416
417
  this.$description.submitting.set(false);
417
418
  this.emit('afterSubmit', this);