eishub / eis

The Environment Interface Standard (EIS) is a Java-based interface standard for connecting agents to controllable entities in an environment such as a game. The interface provides support for managing the connection (e.g., for pausing and terminating an environment) and for interaction between agents and entities that are available in an environment (e.g., bots in a game). An agent that is connected to a controllable entity receives percepts from and can send actions to that entity. Percepts inform the agent about the state of the entity and its environment. Actions tell the entity which actions to perform in its environment. Several example implementations of environments are available @github.com/eishub. A default implementation of the EIS interface is also provided.
GNU General Public License v3.0
9 stars 4 forks source link

EIS not unwrapping InvocationTargetExceptions -> real cause does not show #41

Closed Wouter1 closed 10 years ago

Wouter1 commented 10 years ago

EIS does internally use method.invoke()

This can use a InvocationTargetException if something throws inside the call.

EIS passes this exception un-modified up in DefaultActionHandler line 126

        } catch (InvocationTargetException e) {
            throw new ActException(ActException.FAILURE, "Action "
                    + action.getName() + " with parameters " + parameters
                    + " failed to execute", e);
        }

This is unfortunate because InvocationTargetException does not print the inner cause. This is probably because it puts the causing exception in the internal 'target' field in stead of the normal 'cause' field.

Because of this, end users will not be able to see the real cause of the InvocationTargetException, the stacktrace bottoms out at the InvocationTargetException

Wouter1 commented 10 years ago

Labeled this as 'bug' because this is considered a bug in BW4T3 where this problem appears T#3215

Wouter1 commented 10 years ago

Can we put this to high prio, as #3215 is high prio?

Wouter1 commented 10 years ago

how to repro: use BW4T3 , use a map that contains a room without doors, and try to go there.

You can just run start the server and client jar files. And use a map that I will try to attach.

Wouter1 commented 10 years ago

I changed the code such that EIS adds the targetException of the InvocationTargetException as the cause, instead of the InvocationTargetException itself.

Wouter1 commented 10 years ago

The problem is still there. I suspect that this a build problem, because it was decided tonot increase the EIS version number.

Wouter1 commented 10 years ago

I can not attach the required files to make this a good bug report. I will continue work on this ticket on trac

Unfortunately, we don't support that file type. Try again with a PNG, GIF, or JPG.

http://ii.tudelft.nl/trac/goal/attachment/ticket/3316/

Wouter1 commented 10 years ago

fixed, EIS now adds the stacktrace that caused the InvocationTargetException instead of the InvocationTargetException itself.