Skip to content

Commit

Permalink
Catch UnknownFileTypeError
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrnr committed Sep 3, 2019
1 parent 678abf1 commit 9c3f88b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mnelab/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
from .dialogs.epochdialog import EpochDialog
from .dialogs.xdfstreamsdialog import XDFStreamsDialog
from .widgets.infowidget import InfoWidget
from .model import (SUPPORTED_IMPORTS, SUPPORTED_EXPORTS,
LabelsNotFoundError, InvalidAnnotationsError)
from .model import (SUPPORTED_IMPORTS, SUPPORTED_EXPORTS, LabelsNotFoundError,
InvalidAnnotationsError, UnknownFileTypeError)
from .utils import have, parse_xdf, parse_chunks, split_fname
# all icons are stored in mnelab/resources.py, which must be automatically
# generated with "pyrcc5 -o mnelab/resources.py mnelab.qrc"
Expand Down Expand Up @@ -407,6 +407,8 @@ def open_data(self, fname=None):
self.model.load(fname)
except FileNotFoundError as e:
QMessageBox.critical(self, "File not found", str(e))
except UnknownFileTypeError as e:
QMessageBox.critical(self, "Unknown file type", str(e))

def open_file(self, f, text, ffilter):
"""Open file."""
Expand Down

0 comments on commit 9c3f88b

Please # to comment.