server won't exit if error is handled