python使用raise ValueError('修改信息失败')抛出异常,使用如下捕获异常:
except ValueError as e:
traceback.print_exc()
return {
'msg': e, #错误写法
'code': 400,
}
except ValueError as e:
traceback.print_exc()
return {
'msg': str(e), #正确写法
'code': 400,
}


