Giter Site home page Giter Site logo

What to do with error handling? about bito HOT 6 CLOSED

matsen avatar matsen commented on August 16, 2024
What to do with error handling?

from bito.

Comments (6)

matsen avatar matsen commented on August 16, 2024

Hm, naked exceptions don't get nicely printed unless you use one of the std::exception subclasses.

You can get a line number using a backtrace:

#6  0x000055555555b91f in sbn_ParseFile (inst=0x555555789c20, fname=0x55555556b228 "data/four_taxon.tre") at _build/libsbn.cpp:13

I don't want to have to ask users to do this to get detailed information on their errors. Perhaps a better solution is to use a compiler macro like so.

from bito.

matsen avatar matsen commented on August 16, 2024

Also, am I mostly going to be using asserts? If so, should they be the doctest asserts?

from bito.

matsen avatar matsen commented on August 16, 2024

Going to use exceptions. When we make the switch, don't forget to drop the corresponding iostream includes.

from bito.

matsen avatar matsen commented on August 16, 2024

Can we have the messages available in Jupyter?

from bito.

christiaanjs avatar christiaanjs commented on August 16, 2024

Pybind documentation on redirecting std::cerr and std::cout to Python: https://pybind11.readthedocs.io/en/stable/advanced/pycpp/utilities.html#capturing-standard-output-from-ostream

from bito.

matsen avatar matsen commented on August 16, 2024

Closed by 93cf7b6

from bito.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.