# -*- coding: utf-8 -*-
"""Navigator Exceptions and Exception handling module."""
import os
import tempfile
from traceback import format_exc
import typing
from urllib.request import pathname2url
import webbrowser
from anaconda_navigator.widgets.dialogs import MessageBoxError
from anaconda_navigator.utils.logs import logger
def display_qt_error_box(error, traceback):
"""Display a Qt styled error message box."""
text = f'An unexpected error occurred on Navigator start-up
{error}'
trace = f'{traceback}'
msg_box = MessageBoxError(
title='Navigator Start Error',
text=text,
error=trace,
report=False, # Disable reporting on github
learn_more=None,
)
msg_box.setFixedWidth(600)
return msg_box.exec_()
def display_browser_error_box(error, traceback):
"""Display a new browser window with an error description."""
template = '''
An unexpected error occurred on Navigator start-up
Please report this issue in the anaconda issue tracker
{error}
{trace}