Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webapi-Swagger : Keep track of all errors and report them at the end instead of failing abruptly #15

Open
kahlil29 opened this issue Feb 25, 2019 · 1 comment
Assignees
Labels
Webapi-Swagger All issues related to Webapi-swagger (generation of Webapi contracts from Swagger Docs)

Comments

@kahlil29
Copy link
Contributor

Currently we error out the program in a lot of places where we encounter unexpected values or situations.
Instead of this, we need to collect all the errors (via State) and output them at the end of generation.

As discussed with @ersran9 , an alternative way of doing this would be in the mtl style with Validations, but since we already have the State monad in a lot of our core functions, it should be relatively easier to implement by extending the state to a tuple containing already existing [CreateNewType] so that it would end up becoming
([CreateNewType], [ErrMsg])

@kahlil29 kahlil29 added the Webapi-Swagger All issues related to Webapi-swagger (generation of Webapi contracts from Swagger Docs) label Feb 25, 2019
@kahlil29 kahlil29 self-assigned this Feb 25, 2019
@kahlil29
Copy link
Contributor Author

Note : The type ErrMsg would be a sum-type consisting of the classes of possible errors that we could encounter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Webapi-Swagger All issues related to Webapi-swagger (generation of Webapi contracts from Swagger Docs)
Projects
None yet
Development

No branches or pull requests

1 participant