handle thrown errors inside Route

close #2029