We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f955878 commit acf2fc6Copy full SHA for acf2fc6
jupyter_server/extension/application.py
@@ -213,11 +213,15 @@ def _default_url(self):
213
def _default_serverapp(self):
214
# load the current global instance, if any
215
if ServerApp.initialized():
216
- return ServerApp.instance()
217
- else:
218
- # serverapp accessed before it was defined,
219
- # declare an empty one
220
- return ServerApp()
+ try:
+ return ServerApp.instance()
+ except Exception:
+ # error retrieving instance, e.g. MultipleInstanceError
+ pass
221
+
222
+ # serverapp accessed before it was defined,
223
+ # declare an empty one
224
+ return ServerApp()
225
226
_log_formatter_cls = LogFormatter
227
0 commit comments