raise exceptions using the external throw module

Signed-off-by: Jan Dvořák <mordae@anilinux.org>