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

Better errors for "Invalid type". #14

Open
Yomguithereal opened this issue Dec 16, 2014 · 7 comments
Open

Better errors for "Invalid type". #14

Yomguithereal opened this issue Dec 16, 2014 · 7 comments

Comments

@Yomguithereal
Copy link
Collaborator

To be nitpicky, it would be really nice to have the concerned type in the error message when 'Invalid type' errors occur.

@XeniaSiskaki
Copy link

Is the library not maintained anymore?

@Yomguithereal
Copy link
Collaborator Author

Hello @XeniaSiskaki. Rather, the library has be kinda stable for a long time and suit our uses very well. But don't hesitate to open issues or pull requests if you want/need to see it evolve.

@XeniaSiskaki
Copy link

We have been using it for a long time now as well without problems. I'm just interested in improving this "Invalid Type" error.

@Yomguithereal
Copy link
Collaborator Author

Can you remind me when it occurs? I think I forgot it.

@XeniaSiskaki
Copy link

Well, I have no idea. We see this error in production and I only know it comes from the typology.js file line 225 in our case.

I couldn't reproduce it locally, that's why I think a better error message would be very helpful. One specifying which cursor has a wrong type and what it was expecting vs. the type it got.

@XeniaSiskaki
Copy link

I found out why this is thrown. The code snippet is the following:
typology.check('any', 1)

Basically, any refers to a loading cursor we have defined and in this case it has value 1. Is this logical that it happens? Shouldn't 1 be considered as any? Should I open a new issue?

@XeniaSiskaki
Copy link

Turns out any is not a valid type. Disregard my previous comment.

Still the better error message would be very helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants