ParseServer UnhandledPromiseRejectionWarning:未处理的承诺被拒绝

时间:2018-10-10 03:22:51

标签: parse-server

我只是将parse-server升级到3.0.0,将js-sdk升级到2.1.0。

Parse.Cloud.define('delete_account', function(request) {
var user = request.user;
user.set("delete",true);
user.save(null,{useMasterKey:true}).then(function(user){
    return "account deleted,please logout";
}).catch(function (reason) {
    throw "delete fail";
});

当我调用函数时说:
(node:27120) UnhandledPromiseRejectionWarning: delete fail
(node:27120) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

0 个答案:

没有答案