完成异常处理和简单测试
Signed-off-by: rechard <rechard1846@gmail.com>