V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
tarjintor
V2EX  ›  Python

各位在写一个比较复杂的程序时,会自己设计一套异常类吗

  •  
  •   tarjintor · 2017-03-31 14:32:43 +08:00 · 1485 次点击
    这是一个创建于 2594 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我最近写了一个比较复杂的程序,就在思考这个问题,我需要自己去设计特定的异常类吗?
    如果要设计异常类,有什么注意的原则吗,感觉如果考虑各种可能出现异常的地方,我感觉可能出错的地方好多,设计起来就特别费劲了,不知道怎么搞了
    huclengyue
        1
    huclengyue  
       2017-04-01 09:42:41 +08:00
    不管是什么语音,只要你觉得有必要就可以自己写一个,什么是有必要呢?我觉得只要是自己对异常要二次处理就是有必要
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3432 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 12:31 · PVG 20:31 · LAX 05:31 · JFK 08:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.