catch bad uri error so the server does not crash

This patch prevents the server from crashing in case the uri parsing fails.