我的恳切请求提供了优质和回报数据,但我有可能通过未经处理的承诺拒绝警告。 在请求结束时,我增加了渔获量,捕获功能确实收回了一些数据,但警告似乎并没有消失。 它还说了参考错误,它可能发现有变的错误,我不理解,它指的是什么。 我审视了资源,我发现,通常不相干的拒绝承诺是因为没有捕获物,或者捕获量不会退回任何东西,但我的恳求双方都有这种要求。
Here is my fetch request:
fetch(this.request)
.then(response => response.json() )
.then(response => {
if(response.token === null){
return {
status:false,
message:"Incorrect login credentials",
token:response.token
}
}
return {
status:true,
message:"Login successful"
}
},
reject => ({
status:false,
message:"Something is wrong with the server in reject",
reject:reject
}))
.catch(networkError => ({
status:false,
message:"Something is wrong with the server in catch",
networkError
}))
此处为错误:
Possible Unhandled Promise Rejection (id: 0):
ReferenceError: Can t find variable: error
_callee$@http://192.168.2.102:19001/./node_modules/react-native-
scripts/build/bin/crna-entry.bundle?
platform=android&dev=true&hot=false&minify=false:87622:38
tryCatch@http://192.168.2.102:19001/./node_modules/react-native-
scripts/build/bin/crna-entry.bundle?
platform=android&dev=true&hot=false&minify=false:13836:44
invoke@http://192.168.2.102:19001/./node_modules/react-native-
scripts/build/bin/crna-entry.bundle?
platform=android&dev=true&hot=false&minify=false:14024:30
http://192.168.2.102:19001/./node_modules/react-native-scripts/build/bin/crna-
entry.bundle?platform=android&dev=true&hot=false&minify=false:13861:28
tryCatch@http://192.168.2.102:19001/./node_modules/react-native-
scripts/build/bin/crna-entry.bundle?
platform=android&dev=true&hot=false&minify=false:13836:44
invoke@http://192.168.2.102:19001/./node_modules/react-native-
scripts/build/bin/crna-entry.bundle?
platform=android&dev=true&hot=false&minify=false:13894:28
http://192.168.2.102:19001/./node_modules/react-native-scripts/build/bin/crna-
entry.bundle?platform=android&dev=true&hot=false&minify=false:13902:19
tryCallOne@http://192.168.2.102:19001/./node_modules/react-native-
scripts/build/bin/crna-entry.bundle?
platform=android&dev=true&hot=false&minify=false:15825:14
http://192.168.2.102:19001/./node_modules/react-native-scripts/build/bin/crna-
entry.bundle?platform=android&dev=true&hot=false&minify=false:15911:25
http://192.168.2.102:19001/./node_modules/react-native-scripts/build/bin/crna-
entry.bundle?platform=android&dev=true&hot=false&minify=false:6735:24
_callTimer@http://192.168.2.102:19001/./node_modules/react-native-
scripts/build/bin/crna-entry.bundle?
platform=android&dev=true&hot=false&minify=false:6649:15
callImmediatesPass@http://192.168.2.102:19001/./node_modules/react-native-
scripts/build/bin/crna-entry.bundle?
platform=android&dev=true&hot=false&minify=false:6877:19
callImmediates@http://192.168.2.102:19001/./node_modules/react-native-
scripts/build/bin/crna-entry.bundle?
platform=android&dev=true&hot=false&minify=false:6888:39
__callImmediates@http://192.168.2.102:19001/./node_modules/react-native-
scripts/build/bin/crna-entry.bundle?
platform=android&dev=true&hot=false&minify=false:6248:30
http://192.168.2.102:19001/./node_modules/react-native-scripts/build/bin/crna-
entry.bundle?platform=android&dev=true&hot=false&minify=false:6134:32
__guard@http://192.168.2.102:19001/./node_modules/react-native-
scripts/build/bin/crna-entry.bundle?
platform=android&dev=true&hot=false&minify=false:6234:11
flushedQueue@http://192.168.2.102:19001/./node_modules/react-native-
scripts/build/bin/crna-entry.bundle?
platform=android&dev=true&hot=false&minify=false:6133:19
flushedQueue@[native code]
callFunctionReturnFlushedQueue@http://192.168.2.102:19001/./node_modules/react
-native-scripts/build/bin/crna-entry.bundle?
platform=android&dev=true&hot=false&minify=false:6103:31
callFunctionReturnFlushedQueue@[native code]