From d04b35cab5e09a5a3b55b58ba41b778d234665cb Mon Sep 17 00:00:00 2001 From: Pallavi Bharadwaj Date: Sat, 4 Jan 2020 14:03:04 -0800 Subject: [PATCH] descriptive log for port unavailable and port-retries=0 --- notebook/notebookapp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index cfee169e0..e1bac4923 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -1502,8 +1502,12 @@ class NotebookApp(JupyterApp): success = True break if not success: - self.log.critical(_('ERROR: the notebook server could not be started because ' + if self.port_retries: + self.log.critical(_('ERROR: the notebook server could not be started because ' 'no available port could be found.')) + else: + self.log.critical(_('ERROR: the notebook server could not be started because ' + 'port %i is not available.') % port) self.exit(1) @property