migrate exception into lib/