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

Map Key Checker not working / error format improvement. #20

Open
wmdietl opened this issue May 6, 2016 · 6 comments
Open

Map Key Checker not working / error format improvement. #20

wmdietl opened this issue May 6, 2016 · 6 comments

Comments

@wmdietl
Copy link
Member

wmdietl commented May 6, 2016

Click on MapKeyExampleWithWarnings and then Check.

You get a warning message:

Error: Cannot found indicated checker.

The message should be something like:

Error: cannot find checker: NameOfChecker

And then the error should be fixed :-)
Thanks!

@CharlesZ-Chen
Copy link
Collaborator

CharlesZ-Chen commented May 6, 2016

Hi Prof. Dietl, this is because I've changed the mapping of map-key checker in the JAVA backend. In the production clone, do make -c ./CheckerPrinter clean all would solve this error.
Sorry about I forget to notice this change to you...

@wmdietl
Copy link
Member Author

wmdietl commented May 6, 2016

Ah, thanks! That fixed the Map Key Checker issue.
It's still a good idea to clean up the error message.

@CharlesZ-Chen
Copy link
Collaborator

Sure, I will enhanced the format of warning message soon. Thanks!

@CharlesZ-Chen
Copy link
Collaborator

CharlesZ-Chen commented May 6, 2016

Hi Prof. Dietl

Unfortunately, this enhance requirement reveals a design problem of our web:

This error is issued by JAVA backend:

https://github.com/eisop/webserver/blob/master/CheckerPrinter/src/checkerprinter/InMemory.java#L92

And the front-end just catch and print this exception message:

https://github.com/eisop/webserver/blob/master/static/js/cf-frontend.js#L211

The problem is, JAVA backend only aware of the mapping code of a checker but not the checker name, which means I can only let JAVA backend return an exception message with the checker mapping code, and let front-end directly catch and print this exception message.

To enhance the error format in an elegance way, I think I should refactor on both the way of JAVA backend throws exception messages, and the way of front-end catch and print these exception messages. (because there are other kinds of exceptions may throw by JAVA backend and they currently all be catch and printed by the same simple method in the front-end )

Can I think about the solution later on? Or do you have any suggestions on this refactor? I think I need some time to re-design it and I suppose this is not an urgent requirement.

Thanks!

@wmdietl
Copy link
Member Author

wmdietl commented May 6, 2016

I agree that this isn't an important task.
Simply change "Error: Cannot found indicated checker." to "Error: Cannot find indicated checker."
On the front-end side, if you display the command-line with the error message, it should be easy to debug.

@CharlesZ-Chen
Copy link
Collaborator

Sure, will do that.

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

No branches or pull requests

2 participants