error instead of throwing exception manually. error() function will soon appear in kotlin stdlib