Fix a few bugs from server refactor (#1188)

- Fixes #1185 port command line argument was not handle correctly
 - Fixes #1184 was not catching the "DatasetAccessError" exception.
This commit is contained in:
bmccandless
2020-03-02 11:55:57 -08:00
committed by GitHub
parent bf7d7342d5
commit 87efcc0e99
+3 -2
View File
@@ -12,6 +12,7 @@ import click
from server.common.utils import custom_format_warning from server.common.utils import custom_format_warning
from server.common.utils import find_available_port, is_port_available, sort_options from server.common.utils import find_available_port, is_port_available, sort_options
from server.common.errors import DatasetAccessError
from server.data_common.matrix_loader import MatrixDataLoader, MatrixDataCacheManager from server.data_common.matrix_loader import MatrixDataLoader, MatrixDataCacheManager
from server.common.annotations import AnnotationsLocalFile from server.common.annotations import AnnotationsLocalFile
from server.common.app_config import AppConfig from server.common.app_config import AppConfig
@@ -167,7 +168,7 @@ def server_args(func):
"--port", "--port",
"-p", "-p",
metavar="<port>", metavar="<port>",
default=DEFAULT_SERVER_PORT, default=None,
show_default=True, show_default=True,
help="Port to run server on. If not specified cellxgene will find an available port.", help="Port to run server on. If not specified cellxgene will find an available port.",
) )
@@ -313,7 +314,7 @@ def launch(
try: try:
matrix_data_loader.pre_load_validation() matrix_data_loader.pre_load_validation()
except RuntimeError as e: except DatasetAccessError as e:
raise click.ClickException(str(e)) raise click.ClickException(str(e))
file_size = matrix_data_loader.file_size() file_size = matrix_data_loader.file_size()