You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jsonschema provides a rich error tree of info, by parsing each error
we can pull out relevant info and re-write the error messages.
This covers current error handling behaviour.
This includes new error handling behaviour for types and formatting of
the ports field.
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
required.append("Service '{}' has both an image and build path specified. A service can either be built to image or use an existing image, not both.".format(service_name))
required.append("Service '{}' has neither an image nor a build path specified. Exactly one must be provided.".format(service_name))
199
+
else:
200
+
required.append(error.message)
201
+
eliferror.validator=='type':
202
+
msg="a"
203
+
iferror.validator_value=="array":
204
+
msg="an"
205
+
206
+
try:
207
+
config_key=error.path[1]
208
+
type_errors.append("Service '{}' has an invalid value for '{}', it should be {} {}".format(service_name, config_key, msg, error.validator_value))
209
+
exceptIndexError:
210
+
config_key=error.path[0]
211
+
root_msgs.append("Service '{}' doesn\'t have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration options.'".format(config_key))
212
+
eliferror.validator=='required':
213
+
config_key=error.path[1]
214
+
required.append("Service '{}' option '{}' is invalid, {}".format(service_name, config_key, error.message))
0 commit comments