Giter VIP home page Giter VIP logo

Comments (10)

krs-world avatar krs-world commented on August 30, 2024

I think I have fixed all of them.

from bridges-cxx.

dcarmer avatar dcarmer commented on August 30, 2024

setAssignment(int) is still documented as throwing an exception.
If the validation fails, bridges calls exit(EXIT_FAILURE), but this still doesn't throw.

from bridges-cxx.

krs-world avatar krs-world commented on August 30, 2024

I see a throw in the try block (for catching negative assignment numbers. Wouldnt that be caught in the catch block?

from bridges-cxx.

dcarmer avatar dcarmer commented on August 30, 2024

Yeah, exactly. The function throws internally, but also catches it internally, so for documentation purposes it shouldn't be declared as throwing an exception because it will always catch itself, without actually throwing to the user who is calling it.

And again I would recommend changing it like you have for the others. In that, since you already have a check for the throw, it would be better to put the catch calls in the if statement and leave the remainder in the else, without using a try/catch or manual throw altogether.

from bridges-cxx.

krs-world avatar krs-world commented on August 30, 2024

removed try/catch in setAssignment

from bridges-cxx.

dcarmer avatar dcarmer commented on August 30, 2024

Looks good, but it is printing the error message to cout.
This should be changed to cerr, to keep in line with similar situations.

from bridges-cxx.

krs-world avatar krs-world commented on August 30, 2024

fixed.

from bridges-cxx.

dcarmer avatar dcarmer commented on August 30, 2024

setAssignment still seems to be printing to cout not cerr. Additionally Bridges.h's server error msg and visualize functions are also printing to cout instead of cerr.

from bridges-cxx.

krs-world avatar krs-world commented on August 30, 2024

fixed.

from bridges-cxx.

dcarmer avatar dcarmer commented on August 30, 2024

visualize is still using cerr

Also since this is an if else list, I would exclude the explicit "None" check and just leave its code in an else statement at the end, that way if for some odd reason the visualizer type is not one of these types it will still be handled.

from bridges-cxx.

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.