use external throw module to raise exceptions

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