adamtool / webinterface

The web interface for the tool Adam (AdamMC and AdamSYNT) providing an intuitive, visual definition of Petri nets with transits and Petri games, and an interactive interface to the algorithms of AdamMC and AdamSYNT. Contains the repos (as submodules): libs, framework, logics, modelchecking, examples, synthesizer, high-level, webinterface-backend.
http://adam.informatik.uni-oldenburg.de:4567/
GNU General Public License v3.0
5 stars 2 forks source link

Show the reason for NotSupportedGameException. #13

Closed mgieseking closed 4 years ago

mgieseking commented 4 years ago

The exception uniolunisaar.adam.exceptions.pg.NotSupportedGameException should normally have a causing exception with a more detailed reason.

For example when the net is not safe

"Failure reason: uniolunisaar.adam.exceptions.pg.NotSupportedGameException: Could not create solving object."

is printed. Anyhow we should hide "uniolunisaar.adam.exceptions.pg.NotSupportedGameException:".

annyanich commented 4 years ago

I found this exception being thrown in the signature of AdamSynthesizer::getPetriGame(String apt) and/or AdamModelChecker::getPetriNetWithTransits(String apt). I.e. while parsing an APT file. Are there any other places I should expect to see it?

mgieseking commented 4 years ago

It is also in the signature of most of the methods in AdamSynthesizer. For example checking the existence of a strategy or calculating the strategy.

annyanich commented 4 years ago

Okie dokie, now the error would just be "Failure reason: Could not create solving object." That's what you wanted, right?

Edit: Oops. Sent the comment too soon by mistake

annyanich commented 4 years ago

I figured you probably want to see the full message stating that the net is not safe. So as of commit 57378d2196adb5d65e7111542de68d1492864659, it would look like this:

"Failure reason: Could not create solving object. Net is not safe. Unsafe place: Node{id=E2} Sequence: []"

Does that look good to you?

mgieseking commented 4 years ago

Exactly, perfect, thanks ;).