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

Make errors more clear when using an interface with a method. #39

Open
jacobgardner opened this issue Jul 24, 2019 · 0 comments
Open

Make errors more clear when using an interface with a method. #39

jacobgardner opened this issue Jul 24, 2019 · 0 comments
Labels
enhancement New feature or request High Priority

Comments

@jacobgardner
Copy link
Owner

Is your feature request related to a problem? Please describe.
When an interface being passed to isType contains a function, we get a stack trace with little indication of what the true error is.

Describe the solution you'd like
Either strip the functions (somehow notifying the user), or give a useful console error.

Error: Unknown type "function"
    at ChainTypeFormatter.getTypeFormatter (/Users/jgardner/ts-audit/node_modules/ts-json-schema-generator/dist/src/ChainTypeFormatter.js:27:15)
    at ChainTypeFormatter.getChildren (/Users/jgardner/ts-audit/node_modules/ts-json-schema-generator/dist/src/ChainTypeFormatter.js:19:21)
    at CircularReferenceTypeFormatter.getChildren (/Users/jgardner/ts-audit/node_modules/ts-json-schema-generator/dist/src/CircularReferenceTypeFormatter.js:28:76)
    at type.getTypes.reduce (/Users/jgardner/ts-audit/node_modules/ts-json-schema-generator/dist/src/TypeFormatter/UnionTypeFormatter.js:38:78)
    at Array.reduce (<anonymous>)
    at UnionTypeFormatter.getChildren (/Users/jgardner/ts-audit/node_modules/ts-json-schema-generator/dist/src/TypeFormatter/UnionTypeFormatter.js:38:14)
    at ChainTypeFormatter.getChildren (/Users/jgardner/ts-audit/node_modules/ts-json-schema-generator/dist/src/ChainTypeFormatter.js:19:44)
    at CircularReferenceTypeFormatter.getChildren (/Users/jgardner/ts-audit/node_modules/ts-json-schema-generator/dist/src/CircularReferenceTypeFormatter.js:28:76)
    at properties.reduce (/Users/jgardner/ts-audit/node_modules/ts-json-schema-generator/dist/src/TypeFormatter/ObjectTypeFormatter.js:39:44)
    at Array.reduce (<anonymous>)
@jacobgardner jacobgardner added enhancement New feature or request High Priority labels Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request High Priority
Projects
None yet
Development

No branches or pull requests

1 participant