exception handling

throwing exception instead of emitting error. Added error event.

Signed-off-by: DominicBoettger <Dominic.Boettger@inspirationlabs.com>