spec: don't eat formSubmit errors in test/development
let the js error propagate up so we can fix any bugs; if/once no specs fail, we should remove the try/catch altogether this should hopefully help track down the new intermittent failures in ./spec/selenium/profile_spec.rb:174 Change-Id: Ie5111d971530979c78e10a5c2b574687c5994b18 Reviewed-on: https://gerrit.instructure.com/77756 Tested-by: Jenkins Reviewed-by: Landon Wilkins <lwilkins@instructure.com> Product-Review: Landon Wilkins <lwilkins@instructure.com> QA-Review: Landon Wilkins <lwilkins@instructure.com>
This commit is contained in:
parent
22e6f2edc1
commit
2a7750197f
|
@ -86,7 +86,10 @@ define([
|
|||
var newData = null;
|
||||
try {
|
||||
newData = options.processData.call($form, formData);
|
||||
} catch(e) { error = e; }
|
||||
} catch(e) {
|
||||
error = e;
|
||||
if (INST && INST.environment !== 'production') throw error;
|
||||
}
|
||||
if(newData === false) {
|
||||
return false;
|
||||
} else if(newData) {
|
||||
|
@ -101,7 +104,10 @@ define([
|
|||
submitParam = null;
|
||||
try {
|
||||
submitParam = options.beforeSubmit.call($form, formData);
|
||||
} catch(e) { error = e; }
|
||||
} catch(e) {
|
||||
error = e;
|
||||
if (INST && INST.environment !== 'production') throw error;
|
||||
}
|
||||
if(submitParam === false) {
|
||||
return false;
|
||||
}
|
||||
|
@ -150,9 +156,6 @@ define([
|
|||
}
|
||||
if(error && !options.preventDegradeToFormSubmit) {
|
||||
if (loadingPromise) loadingPromise.reject();
|
||||
if(INST && INST.environment == 'development') {
|
||||
$.flashError('formSubmit error, trying to gracefully degrade. See console for details');
|
||||
}
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
|
|
Loading…
Reference in New Issue