Add exception handling for thread url opening to cli.
Remove an unused import.