Closed john-kheir closed 6 years ago
@john-kheir , there is no check for nonexistent fields. Checks provided in the templates validate only that required fields are provided. In case of openvcloud template provider
key is optional and has default value itsyouonline
, therefore the faulty key will be added to schema, but never used, while default value is used instead. If required field like name
is not given correctly (n\ame
), the error will occur pointing out that name
is not given.
I think the error has occurred because account
service uses openvcloud service that doesn't exist, so ServiceNotFoundError
is the correct error.
@katia-e As we discussed .. seems this is not an issue as the error says "Service Not Found" which is true .. but please check if we can make this error clear by specifying the service that wasn't found.
This need to be handle in the template code, catch the error and wrap it with proper error message for end user: https://github.com/zero-os/0-robot/issues/198#issuecomment-389534596
@zaibon , I did try to do it like that at first, but @FastGeert insisted we don't catch errors to improve error message and the error message from robot should be clear, so I removed code catching and wrapping errors. @zaibon and @FastGeert, could we please come to a single opinion about it?
@katia-e @FastGeert I can't give you more detail cause in certain case like this one, I don't have more info to return to the caller. So if you really want detail, you have to deal with it in the template and wrap error yourself.
@zaibon Well the error message could be
ServiceNotFoundError: Could not find service of type "github.com/openvcloud/0-templates/openvcloud/0.0.1" with name "49d99b4f", which is what @john-kheir expects. This data you have at your disposal.
Not always that's what I'm saying.
Scenario
1- Run a blueprint to create an account using non-existing openvlcoud param
Blueprint
Server Error:
Expected Result
Server Error saying that non existing openvcloud param was provided to the account service