UMLComputerGraphics / GraphicsProject

UML Graphics 2 Final Project 2013
7 stars 1 forks source link

User-Defined Functions needs to be able to intercept exceptions #104

Closed jnsnow closed 11 years ago

jnsnow commented 11 years ago

When you call set() on a uvf to change its function, you NEED to put it in a try { ... } catch ( ... ) { } block.

When you catch the exception, please display to the user the message.

example

If I type 0.01 * cos(x) * asdf, I see this in the terminal: terminate called after throwing an instance of 'std::invalid_argument' what(): ERR40 - Undefined variable or function: 'asdf'

What should happen is that you show this error to the user.

@franckamayou @zmaybury @MillCityRep -- anyone who can fix this before tomorrow :)

zmaybury commented 11 years ago

Sorry John, my Internet just decided to die. What did you guys need?

Sent from my iPhone

On May 8, 2013, at 1:32 AM, "John Snow" notifications@github.com<mailto:notifications@github.com> wrote:

When you call set() on a uvf to change its function, you NEED to put it in a try { ... } catch ( ... ) { } block.

When you catch the exception, please display to the user the message.

example

If I type 0.01 * cos(x) * asdf, I see this in the terminal: terminate called after throwing an instance of 'std::invalid_argument' what(): ERR40 - Undefined variable or function: 'asdf'

What should happen is that you show this error to the user.

@franckamayouhttps://github.com/franckamayou @zmayburyhttps://github.com/zmaybury @MillCityRephttps://github.com/MillCityRep -- anyone who can fix this before tomorrow :)

— Reply to this email directly or view it on GitHubhttps://github.com/UMLComputerGraphics/GraphicsProject/issues/104.

jnsnow commented 11 years ago

I added a quick exception catch to this in MONOLITH.cpp see push c87a715d670c58d5bdb9115d3e2560c246860550

jnsnow commented 11 years ago

So what we really need now is a way to tell the user what went wrong in the GUI.

C-Compton commented 11 years ago

I'll look into it... Would appreciate if @zmaybury and @franckamayou did as well.

My idea is to have a pop-up window (widget) displaying the error to the user. I doing this, we should disable or hide the main window widget until the user acknowledges the message, at which point we can re-enable/re-display the main window.

jnsnow commented 11 years ago

Can you just create a text box or something and have it show the latest error? A popup is fine too, anythin' works.

C-Compton commented 11 years ago

That would certainly be a lot easier! o.O

C-Compton commented 11 years ago

Message displays to user.