Moved error handling to KraftwerkException class