使用node-soap库创建了一个SOAP API,但是当我尝试使用以下方法抛出错误时
throw {
Fault: {
Code: {
Value: 'soap:Sender',
Subcode: { value: 'rpc:BadArguments' }
},
Reason: { Text: 'Processing Error' }
}
};
根据图书馆的描述,我得到了一个
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: 1)
这是我目前正在做的
ssm.decrypt(args.request, password, base_key)
.then(function (res) {
console.log(res)
parseString(res, async function (err, result) {
if (err) {
//the throws causes the error
throw {
Fault: {
error: {
data: {
error
} //Error object from catch
}
}
};
} else {
//some code
}
谢谢
天涯尽头无女友
喵喵时光机
相关分类