You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: #2138 linter issues with fail function (#2171)
* fix: #2138 linter issues with fail function
- refactoring fail function to be a custom Error class
- adjusting throw class given the above changes
- adding missing imports
- removing unused imports
* adding tests
* typo
Copy file name to clipboardexpand all lines: src/core/action.ts
+3-3
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
import{actionasmobxAction}from"mobx"
2
2
import{
3
3
getStateTreeNode,
4
-
fail,
4
+
MstError,
5
5
argsToArray,
6
6
IDisposer,
7
7
getRoot,
@@ -292,12 +292,12 @@ function runMiddleWares(
292
292
if(devMode()){
293
293
if(!nextInvoked&&!abortInvoked){
294
294
constnode2=getStateTreeNode(call.tree)
295
-
throwfail(
295
+
thrownewMstError(
296
296
`Neither the next() nor the abort() callback within the middleware ${handler.name} for the action: "${call.name}" on the node: ${node2.type.name} was invoked.`
297
297
)
298
298
}elseif(nextInvoked&&abortInvoked){
299
299
constnode2=getStateTreeNode(call.tree)
300
-
throwfail(
300
+
thrownewMstError(
301
301
`The next() and abort() callback within the middleware ${handler.name} for the action: "${call.name}" on the node: ${node2.type.name} were invoked.`
0 commit comments