Generally,it show request interface:
async valid
let res=await function() // interface function
if(res.code!==约定好的200或者0000){
console.log(res.message);
}else{
}
we can get the data and the error
but
if the interface error or the data block,not catch the data or the interface error
maybe use
try{
let res=await function() // interface function
}catch((error)=>{
console.log(error.message);
})