Better handling of errors by router