unhandled exception type

场景:Unhandled exception type UsersException解决办法

Unhandled exception type UsersException解决方法!
点击右边红色标题查看本文完整版:Unhandled exception type UsersException解决方法!

以下是我的代码,大家帮我看一下是什么问题:
public class UsersException extends Exception{
public UsersException(){

}

public UsersException(String msg){
super(msg);
}
}


public void addUser(String username, String password) {
// TODO Auto-generated method stub
try{
Users users = new Users();
users.setUsername(username);
users.setPassword(password);
usersDao.save(users);
}catch(Exception e){
log.debug(e.getMessage());
throw new UsersException( "发生错误 ");
}
}

以上代码编译都不能够通过的
会提示:Unhandled exception type UsersException

------解决方法--------------------
public void addUser(String username, String password)
改成
public void addUser(String username, String password) throws UsersException
------解决方法--------------------
没有处理自己抛出的异常了。。。