Launch validation (#414)

* WIP

* Cleanup

* Validation

* typo

* Max category limit 100 -> 500
This commit is contained in:
Charlotte Weaver
2018-11-07 13:01:13 -08:00
committed by GitHub
parent a9189017c7
commit 7d5c054b90
10 changed files with 204 additions and 141 deletions
+2 -24
View File
@@ -3,6 +3,8 @@ from argparse import ArgumentTypeError
from numpy import float32, integer
from server.app.util.errors import MimeTypeError
class Float32JSONEncoder(json.JSONEncoder):
def default(self, obj):
@@ -13,30 +15,6 @@ class Float32JSONEncoder(json.JSONEncoder):
return json.JSONEncoder.default(self, obj)
class MimeTypeError(Exception):
def __init__(self, message):
self.message = message
class FilterError(Exception):
def __init__(self, message):
self.message = message
class InteractiveError(Exception):
def __init__(self, message):
self.message = message
class PrepareError(Exception):
def __init__(self, message):
self.message = message
def get_mime_type(default="application/json", acceptable_types=["application/json", "text/csv"], query_param=None,
header=None):
mime_type = default