fix: if going to throw error, construct a new one

This commit is contained in:
EnixCoda 2019-02-23 20:13:05 +08:00
parent eed111e2aa
commit c9490647a2
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD

View file

@ -74,7 +74,7 @@ function link<P, S>(instance: React.Component<P, S>, sources: Sources<P, S>): Wr
const isFromSource = sourcesValues.includes(createMethod)
if (isFromSource) {
const method = map.get(createMethod)
if (!method) throw Error('Method not found')
if (!method) throw new Error('Method not found')
const runnable = applyMiddlewares(method, otherArgs)
run(runnable)
}