问答详情
源自:3-5 定义通用的返回对象--异常处理02

为什么代码跟老师一样,还是500界面

java.lang.IllegalStateException: Could not resolve parameter [0] in public java.lang.Object com.miaoshaproject.controller.UserController.handleException(javax.servlet.http.HttpServletRequest,java.lang.Exception): No suitable resolver


提问者:精慕门9468299 2020-04-17 19:48

个回答

  • 姜媎
    2023-03-30 16:52:19

    判空一下

    UserModel (Integer id) {
        UserDO userDO = .selectByPrimaryKey(id)(userDO==){
            }
        UserpasswordDO userpasswordDO = .selectByUserId(userDO.getId())convertFromDataObject(userDOuserpasswordDO)}

    不然捕获的异常是空指针异常不是自定义异常,所以报的还是500