diff --git a/src/core/plugins/err/error-transformers/hook.js b/src/core/plugins/err/error-transformers/hook.js index 47df3af4f28..038094829dc 100644 --- a/src/core/plugins/err/error-transformers/hook.js +++ b/src/core/plugins/err/error-transformers/hook.js @@ -7,9 +7,13 @@ const errorTransformers = [ ParameterOneOf ] -export default function transformErrors (errors, system) { +export default function transformErrors (errors) { + // Dev note: unimplemented artifact where + // jsSpec: system.specSelectors.specJson().toJS() + // regardless, to be compliant with redux@4, instead of calling the store method here, + // jsSpec should be pass down as an argument, let inputs = { - jsSpec: system.specSelectors.specJson().toJS() + jsSpec: {} } let transformedErrors = reduce(errorTransformers, (result, transformer) => { diff --git a/src/core/plugins/err/reducers.js b/src/core/plugins/err/reducers.js index 8a9cbbbae22..17f88d281e3 100644 --- a/src/core/plugins/err/reducers.js +++ b/src/core/plugins/err/reducers.js @@ -19,13 +19,13 @@ let DEFAULT_ERROR_STRUCTURE = { message: "Unknown error" } -export default function(system) { +export default function() { return { [NEW_THROWN_ERR]: (state, { payload }) => { let error = Object.assign(DEFAULT_ERROR_STRUCTURE, payload, {type: "thrown"}) return state .update("errors", errors => (errors || List()).push( fromJS( error )) ) - .update("errors", errors => transformErrors(errors, system.getSystem())) + .update("errors", errors => transformErrors(errors)) }, [NEW_THROWN_ERR_BATCH]: (state, { payload }) => { @@ -34,7 +34,7 @@ export default function(system) { }) return state .update("errors", errors => (errors || List()).concat( fromJS( payload )) ) - .update("errors", errors => transformErrors(errors, system.getSystem())) + .update("errors", errors => transformErrors(errors)) }, [NEW_SPEC_ERR]: (state, { payload }) => { @@ -42,7 +42,7 @@ export default function(system) { error = error.set("type", "spec") return state .update("errors", errors => (errors || List()).push( fromJS(error)).sortBy(err => err.get("line")) ) - .update("errors", errors => transformErrors(errors, system.getSystem())) + .update("errors", errors => transformErrors(errors)) }, [NEW_SPEC_ERR_BATCH]: (state, { payload }) => { @@ -50,8 +50,8 @@ export default function(system) { return fromJS(Object.assign(DEFAULT_ERROR_STRUCTURE, err, { type: "spec" })) }) return state - .update("errors", errors => (errors || List()).concat( fromJS( payload )) ) - .update("errors", errors => transformErrors(errors, system.getSystem())) + .update("errors", errors => (errors || List()).concat(fromJS(payload))) + .update("errors", errors => transformErrors(errors)) }, [NEW_AUTH_ERR]: (state, { payload }) => { @@ -60,7 +60,7 @@ export default function(system) { error = error.set("type", "auth") return state .update("errors", errors => (errors || List()).push( fromJS(error)) ) - .update("errors", errors => transformErrors(errors, system.getSystem())) + .update("errors", errors => transformErrors(errors)) }, [CLEAR]: (state, { payload }) => {